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