jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes No database selected error in jdbc for mysql application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "No database selected error in jdbc for mysql application" Watch "No database selected error in jdbc for mysql application" New topic
Author

No database selected error in jdbc for mysql application

rk sharma
Ranch Hand

Joined: Jun 25, 2011
Posts: 50



and the error is

"No database selected"

very simple application how to resolve this one...please help me
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Dec 20, 2006
Posts: 2491
    
    8

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?


OCUP UML fundamental and ITIL foundation
youtube channel
rk sharma
Ranch Hand

Joined: Jun 25, 2011
Posts: 50

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?
 
jQuery in Action, 2nd edition
 
subject: No database selected error in jdbc for mysql application
 
Similar Threads
Unable to inject @Resource into ApplicationClient using ACC
Getting Error Message from Server
Adding components dynamically
Need to pass information from MS Access database to another program
Unable to Access mysql database through JNDI.