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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 18570
    
    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: 2499
    
    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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No database selected error in jdbc for mysql application