aspose file tools*
The moose likes JDBC and the fly likes JDBC-ODBC bridge any other options Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC-ODBC bridge any other options" Watch "JDBC-ODBC bridge any other options" New topic
Author

JDBC-ODBC bridge any other options

Jack Cameron
Greenhorn

Joined: Jan 29, 2001
Posts: 3
Suppose I do not want to use JDBC-ODBC bridge because I want improved performance of JDBC Drive for a specific DBMS but I do not know what sort of DBMS that the application will be using. How can I make my application open to use any DBMS without having to change the source everytime?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Read the database info in from a properties file.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Jack Cameron
Greenhorn

Joined: Jan 29, 2001
Posts: 3
Thanks Thomas Paul. How do I go about finding the properties file of a database and when I find it how do I find out what type it is?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You misunderatnd. Create a properties file (mydatabase.properties) and put in it the information about your database:
db.driver=com.sybase.jdbc.SybDriver
db.user=user
db.password=password
db.url=jdbc:sybase:Tds:myserver:5150/mydatabase
Instead of hardcoding this information into your program, read it in. Now if you change databases, you just change the properties file.
Jack Cameron
Greenhorn

Joined: Jan 29, 2001
Posts: 3
Thanks Thomas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC-ODBC bridge any other options