• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JDBC Error : No database selected

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 308
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic