aspose file tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply 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: 16483
    
    2

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: 2343

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
ITIL foundation
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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: No database selected error in jdbc for mysql application
 
Similar Threads
Adding components dynamically
Unable to inject @Resource into ApplicationClient using ACC
Getting Error Message from Server
Unable to Access mysql database through JNDI.
Need to pass information from MS Access database to another program