Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to connect to mysql database?

 
Kavitha Sen
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!