![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> How can i program JDBC using jdbc odbc bridge driver, using file dsn or dsnless connection.. I couldn't get the bridge to let me use a DSN, so I improvised a bit. I said. I will pass in the info it needs. The error I was getting from the Driver said that the data source was not found and that no "DEFAULT DRIVER was specified", so I did this. I created a file DSN. Then I took the options and seperated them with the semicolon(;). For the actual DSN name if you noticed, I left it blank and just put a semicolon in front of it. This got passed to the Microsoft odbc manager, and worked like a charm. This particular code runs with a Fox Pro db(free directory table), but will work other ODBC drivers as well, as long as you get the options for the driver correct. If you mess up the options you will get errors. Well, I hope this helps you out and many other people out all the same. READ BELOW FOR THE CODE! Here is the code(You will have to work out the database and make sure you have it, or change the code): import java.sql.*; public class odbc public static void main(String args[]) try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); }//end try
}//end class odbc Replies: |
Sponsored Links
|