• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to set property of jdbc?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to write code in "???" in the following code:

//special location of database on filesystem
System.setProperty("???","D:/mysql-connector-java-3.0.17-ga");

//load database driver class
Class.forName(org.gjt.mm.mysql.Driver);

//establish connection to database
statement=connection.createStatement();

//query database
ResultSet resultset=statement.executeQuery("select*from author");

i can't find answer in sun

the database i want load is located in"D:\Program Files\MySQL\MySQL Server 5.0\data\test"
[ February 25, 2006: Message edited by: Bear Bibeault ]
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeffrey,
Where's the code to actually get a connection? That's usually where you specify the database.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And with MySQL, you don't specify the location of the database. You specify the location of the MySQL server (machine and port) and the name of the database only.

All of this is covered in the documentation for the MySQL JDBC driver.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic