aspose file tools
The moose likes JDBC and Relational Databases and the fly likes how to set property of jdbc? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "how to set property of jdbc?" Watch "how to set property of jdbc?" New topic

how to set property of jdbc?

Jeffrey Ye

Joined: Feb 18, 2006
Posts: 24
how to write code in "???" in the following code:

//special location of database on filesystem

//load database driver class

//establish connection to database

//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 ]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 31634

Where's the code to actually get a connection? That's usually where you specify the database.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Clapham

Joined: Oct 14, 2005
Posts: 19357

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.
I agree. Here's the link:
subject: how to set property of jdbc?