Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No database selected error in jdbc for mysql application

 
Radhakrishna Sharma Gorenta
Ranch Hand
Posts: 63
Google App Engine Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


and the error is

"No database selected"

very simple application how to resolve this one...please help me
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means that you haven't selected a database, like it says. But the selection of the database would be somewhere in the ODBC configuration, so showing us Java code isn't actually of any use.

So either fix your ODBC configuration to select a database, or (a better option) stop using ODBC and use the MySQL JDBC driver.
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Radhakrishna.

While you are learning to connect to MySQL, can I point you to the MySQL jdbc driver in stead of the odbc bridge driver, as Paul advised?

 
Radhakrishna Sharma Gorenta
Ranch Hand
Posts: 63
Google App Engine Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you paul. for your reply.
i already created odbc DSN for MySql.
what would be the actual error,please suggest me.
and please tell me that how to use type4 MySql driver?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic