Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Error : No database selected

 
Arati nargide
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code :






I have added JDBC driver "mysql-connector-java-5.1.20-bin.jar".
Still its saying no Database selected.
Please help...
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem should be here

jdbc:mysql://localhost:3306/

let's say you created a schema named mydb, the connection string must be

jdbc:mysql://localhost:3306/mydb
 
Arati nargide
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicola Garofalo wrote:the problem should be here

jdbc:mysql://localhost:3306/

let's say you created a schema named mydb, the connection string must be

jdbc:mysql://localhost:3306/mydb



Oh, Thank you very much.
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me know if it works.

Anyway that's mysql tutorial link on connecting to mySql using DriverManager

http://dev.mysql.com/doc/refman/5.6/en/connector-j-usagenotes-connect-drivermanager.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic