aspose file tools*
The moose likes JDBC and the fly likes How to connect to mysql database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to connect to mysql database?" Watch "How to connect to mysql database?" New topic
Author

How to connect to mysql database?

Kavitha Sen
Greenhorn

Joined: May 15, 2008
Posts: 28
Dear Ranchers,

I have eclipse ide,tomcat server and mysql database, oracle ide.
I have included ojdbc14.jar in classpath.

Now i like to know how to connect database in eclipse. I mean what code should be included? and where to include? can any one help me.

sorry for asking the basic doubt.
Kavitha Sen
Greenhorn

Joined: May 15, 2008
Posts: 28
hello again,

I copied the following code for database connection.


But i get this error.

Darn! A SQL error: Io exception: The Network Adapter could not establish the connection

What should I do? please help me. Thanks.
aswin kumar
Greenhorn

Joined: Dec 25, 2008
Posts: 12
hi !
configure a jdbc Driver in eclipse, for this windows->showView->DBBrowser->rtClick->someConfiurations like drivername and Login Details and add jar files for Driver

and then make sure Database is in running mode,after that you can execute your program.

regards,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to connect to mysql database?