File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC-ODBC bridge any other options

 
Jack Cameron
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the database info in from a properties file.
 
Jack Cameron
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Thomas
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic