• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MySQL JDBC connection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MySQL JDBC connection


  • Subject: Re: MySQL JDBC connection
  • From: Paul Lynch <email@hidden>
  • Date: Fri, 24 Mar 2006 16:04:23 +0000

Resending, because it didn't show up (and I suspect my mail server).

On 24 Mar 2006, at 04:01, netBrackets wrote:

Now I remember why I have never used a database in my app. While EOM looks like very cool stuff, I can never get past the very first step of getting the EOModeler to connect to my database. Well, I'm trying again (for about the 4th time in as many years) and running into the same old problem. I am using MySQL on Mac OS X Server 10.4.


I see Chuck has been flaming MySQL and recommending FrontBase. Well, let me do the same but recommend OpenBase! :-). Seriously, I have used MySQL where projects require it, without any major disasters. Although I personally wouldn't choose it for a serious project (where my money was on the line), I can't deny that it is popular and lots of people aren't as cautious as I am.



I've started MySQL using the MySQL utitliy, and I've installed the MySQL JDBC adapter (mysql-connector-java-3.0.17-ga.bin.jar) in / Library/Java/Extensions


I have mysql-connector-java-3.1.11-bin.jar in /Library/Java/ Extensions, and I don't get that error. I wouldn't be surprised if there was a more recent adaptor, but that's the one I am using here.



and I get the following error from the EOModeler wizard using a URL of jdbc:mysql://localhost/WOnetBrackets:

JDBC connection failed for driver :'org.gjt.mm.mysql.Driver'. Driver not found in Java Runtime! Please verify your CLASSPATH environment variable. The current CLASSPATH for your application is : /Developer/Applications/WebObjects/EOModeler.app/Contents/ Resources/Java/eomodeler.zip:/Users/netbrackets/Library/Java:/ Library/Java:/System/Library/Java:/Network/Library/Java:/System/ Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/ Library/Frameworks/JavaVM.framework/Classes/ui.jar:/Developer/ Applications/WebObjects/EOModeler.app/Contents/Resources/Java/ eomodeler.zip:/System/Library/Frameworks/JavaVM.framework/Versions/ 1.5.0/Classes/.compatibility/14compatibility.jar


I see /Library/Java there - I believe it should work out the Extensions part automatically.



So, just what is the Driver, and how do I verify my CLASSPATH to I get it into my Java Runtime? Also, I can't seem to find much documentation on setting up WO for different databases (I even searched the archives, which is where I got the info on the MySQL adaptor and where to install it). Does it exist anywhere such that a DB newbie could use it?


The jar you installed is just a package containing org/gjt/mm/mysql/ Driver.class and a few support classes for it (com.mysql.jdbc). Any Java application, WebObjects regardless, that uses JDBC with MySQL will need this. You aren't setting up WebObjects for use with a database, you are setting up Java for use with the database. All you need to know for WebObjects is to set the optional Driver property in the Adaptor Info panel to com.myself.jdbc.Driver (org.gjt.mm.mysql.Driver should work just as well), and the URL to a running database, with the general form: jdbc:mysql://hostname/dbname.


There used to be a web page that told you how to set up WebObjects for MySQL, but I haven't been able to find it recently - don't worry, all it said was pretty much what I have written above.

The most common error with this is mistyping the driver class name somehow. Assuming that this isn't the case, you should check that the jar really does contain the class you have named; use jar tf / Library/Java/Extensions/mysql-connector-java-3.0.17-ga.bin.jar and scan the output. I think you would also want to quit and restart EOModeler at least.

Paul


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: MySQL JDBC connection
      • From: Kieran Kelleher <email@hidden>
References: 
 >MySQL JDBC connection (From: netBrackets <email@hidden>)

  • Prev by Date: Re: Help. Error from jam ??
  • Next by Date: Re: Basic Question
  • Previous by thread: Re: MySQL JDBC connection
  • Next by thread: Re: MySQL JDBC connection
  • Index(es):
    • Date
    • Thread