• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to connect to a db with out a driver

 
sjhyam m
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!
Can I contact and access a database with out using a driver. Is it possible to do with Java? Please give me the required information.
Thanks in advance
Regards
Shyam
 
Tim Lauster
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What type of database are you trying to connect to?
Does the database support ODBC?
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answer:
Unfortunately, you'll need a driver to connect to the database. The java.sql.* is made up of mainly interfaces(no implementation) which means that you can not use them. The drivers are used to implement these interfaces so that you can access the databases, query tables, and process the results. There is a jdbc-odbc bridge from Sun available to ODBC compliant databases...but it is not recommended(lots of headaches!)

Sun's answer:
this is how Sun describes their own Bridge:
"Note that we do not recommend using the Bridge except for experimental purposes or when you have no other driver available. "
see the complete FAQ as it is insightful on the jdbc-odbc bridge as a odbc solution. http://java.sun.com/products/jdbc/faq.html#2
Jamie
[This message has been edited by Jamie Robertson (edited August 14, 2001).]
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For learning purposes, the JDBC-ODBC driver will do fine. Compared to other drivers, it is much slower. So to answer your question, you can use the JDBC-ODBC driver that comes with the JDK to connect to a database as long as it supports ODBC (most do). Good luck!
 
Ashish Saraf
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One will have to use the driver to access the database.
As drivers are the layer between any database and the applications.
The drivers will send commands from application and receive results from the database engine. This is true for any application java is no exception.
Regards,
Ashish Saraf
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic