 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
DrMatrix Guest
|
Posted: Sun Jan 15, 2006 8:10 pm Post subject: MySQL using Eclipse Mac OSX |
|
|
I am using Eclipse 3.1 under Mac OS X 10.4.4. I just downloaded MySQL.
I installed MySQL successfully. I am able to create databases and
tables. And I am able to load them and run queries by running mysql.app.
I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
don't know how to tell Eclipse to look for it. Should I move the .jar
file somewhere, or do I have to do something in Eclipse?
Here is the code I copied:
//---------------------------------------
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// Notice, do not import com.mysql.jdbc.*
// or you will have problems!
public class LoadDriver {
public static void main(String[] args) {
try { // The newInstance() call is a work around for
//some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.print(ex.toString());
}
}
}
//_________________________________
I get java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
|
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Sun Jan 15, 2006 11:03 pm Post subject: Re: MySQL using Eclipse Mac OSX |
|
|
On Sun, 15 Jan 2006 20:10:54 GMT, DrMatrix <DrMatrix (AT) gmail (DOT) com> wrote,
quoted or indirectly quoted someone who said :
| Quote: | I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
don't know how to tell Eclipse to look for it. Should I move the .jar
file somewhere, or do I have to do something in Eclipse?
|
Right click on your project | properties | java build path
Add your jars in there.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
|
| Back to top |
|
 |
DrMatrix Guest
|
Posted: Mon Jan 16, 2006 5:12 am Post subject: Re: MySQL using Eclipse Mac OSX |
|
|
In article <e0lls1tf9i1bosndu8n7l6qotd7jtrpbic (AT) 4ax (DOT) com>,
Roedy Green <my_email_is_posted_on_my_website (AT) munged (DOT) invalid> wrote:
| Quote: | On Sun, 15 Jan 2006 20:10:54 GMT, DrMatrix <DrMatrix (AT) gmail (DOT) com> wrote,
quoted or indirectly quoted someone who said :
I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
don't know how to tell Eclipse to look for it. Should I move the .jar
file somewhere, or do I have to do something in Eclipse?
Right click on your project | properties | java build path
Add your jars in there.
|
That did the trick.
Thank you.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|