Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DSN-less CSV Connection String

843859Feb 1 2006 — edited Feb 3 2006
I've searched the forums extensively as well as other sites and came up with the following line of code to form a dsn-less jdbc connection to a csv file:
DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Text Driver (*.txt;*.csv)};Dbq=\"c:\\test1.csv\";Extensions=asc,csv,tab,txt;Persist Security Info=False");
Which throws the following:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at gui.Test.main(Test.java:25)

Anyone have any thoughts as to what I'm doing wrong here? I don't want to use a third-party library if possible (especially not a commercial one), and I greatly prefer to use jdbc to connect to my csv file for compatibility with the rest of the program.

Thanks,
Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 3 2006
Added on Feb 1 2006
4 comments
361 views