Configuring MySQL JDBC Driver on Mac OS X

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

Are there good instructions on how to install and configure the MySQL Connector/J JDBC driver on a Mac OS X system?

Thanks

df

0
Your rating: None
Americo Savinon
Americo Savinon's picture
User offline. Last seen 1 year 39 weeks ago. Offline
Joined: 09/19/2008
Points: 187

Dave,

You just need to drop the mysql.jar file inside the presto lib folder (presto_home/server/apache/webapps/presto/WEB-INF/lib) and restart your presto server.

To test this you may want to lets say... make a mysql query inside an mashup, take a look at the mashup sample below:

 

<mashup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.jackbe.com/2007-09-15/JMMLSchema ../src/schemas/JMMLSpec.xsd"
    xmlns="http://www.jackbe.com/2007-09-15/JMMLSchema"
    xmlns:prestofn="java:com.jackbe.jbp.jems.moe.commons.DOMUtils"
    xmlns:macro="http://www.jackbe.com/2008-03-01/EMMLMacro"
    name="mySQLQueryMashup">

    <operation name="invoke">

    <output name="result" type="document" />

    <!--mySQL Datasource-->
    <datasource name='dsName' url="jdbc:mysql://localhost/my_Database_Name" username="myUser" password="myPass" driverclassname="com.mysql.jdbc.Driver"/>

    <!-- Query -->
    <sql name='dsName' query="select * from my_Database_Name.myTable" outputvariable="result"/>

    </operation>
</mashup>

 

 Aditionally you may want to use DAO inside Presto, you can do this by creating the Datasource and the DAO in Presto Service Explorer.

 

apolenur
apolenur's picture
User offline. Last seen 2 years 34 weeks ago. Offline
Joined: 09/22/2008
Points: 2

I am not a Mac user, so I might be missing something very Mac specific, but as far as Presto goes configuration is simple. You just need to drop MySQL driver jar (I use mysql-connector-java-5.1.5-bin.jar) into tomcat/webapps/presto/WEB-INF/lib. That is all you need to do to "configure driver". Then you should follow instructions in documentation  on how to provision DB schema in MySQL and how to reconfigure presto to use MySQL instead of HSQLDB.

Hope this helps, Alexi

 

P.S. If it does not please describe specific problem you are facing on Mac

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

 Thanks guys.  Will test it out later today.

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

I dropped the file in and restarted but still am getting a "Cannot load JDBC driver class 'com.mysql.jdbc.Driver'" error.  What am I missing?  Is there something I need to set up in Tomcat? 

Americo Savinon
Americo Savinon's picture
User offline. Last seen 1 year 39 weeks ago. Offline
Joined: 09/19/2008
Points: 187

Make sure you dropped the file in the WEB-INF/lib folder inside the presto app (Presto_home/server/apache/webapps/presto)

 

When do you get the "Cannot load JDBC dribver class" error? Are you running the mashup sample previously posted?

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

double checked the file location. Created the test file in Eclipse 3.4.2. Trying to run within Eclipse.

raj
User offline. Last seen 29 weeks 4 days ago. Offline
Joined: 09/22/2008
Points: 4

Dave,

Mashup studio supports 2 modes for execution i) remote & ii) embed mode.

Are you having this issue with embed mode ?  Can you switch to remote mode and try executing this script ?

raj.  

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

 I'll take a look at this.  It is probably something real easy to figure out.

I am able to create a database service in service explorer through setting up the JDBC.  It is likely something in my Eclipse setup.

df

smitchell
smitchell's picture
User offline. Last seen 28 weeks 2 days ago. Offline
Joined: 08/29/2008
Points: 34

Your example EMML has a <datasource> and is using <sql>. If that is what you are doing, there are additional configuration steps you need to do in Eclipse for this to work in Mashup Studio. Basically, you have to put the JAR for the driver in one of the Mashup Studio plug-ins in Eclipse.

You can find complete instructions for this in Mashup Studio help (or in the Presto Library documentation). The topic is "Configure Datasoure Drivers".

Sara, technical writer/jackbe

 

davefauth
davefauth's picture
User offline. Last seen 4 years 25 weeks ago. Offline
Joined: 01/07/2009
Points: 10

 Sara,

That solved the problem. Thanks so much. Thanks to everyone else for helping out.

df