Hello,
we are using your excel- and access driver for quite a while and are now planning to use yout text driver for accessing csv files. On our first steps we stumbled upon a problem with conncection.getMetaData().getColumns(): the value for tableName is null!
i can provide a litte test programm that shows the issue
Class.forName("com.hxtt.sql.text.TextDriver");
Connection con = DriverManager.getConnection("jdbc:csv:/C:/Users/mw/Desktop/csv/treiber.csv?_CSV_Header=true;_CSV_Separator=\\x3B", "", "");
ResultSet resultSet = null;
resultSet = con.getMetaData().getColumns(null, "dbo", null, null);
while (resultSet.next()) {
String tableName = resultSet.getString("TABLE_NAME");
String column = resultSet.getString("COLUMN_NAME");
System.out.println(tableName+"."+column);
}
Output is:
null.Datum
null.Dauer
null.Beschreibung
null.Aufgabe
null.Jira-TicketNr
null.MA-Kurz
null.JIRA_FIXVERSIONS
column names are correct but table name should be "treiber", i suppose? At least "select * from treiber" works.
Is there something we miss? Querying the metadata ist essential for our application
Regards,
Michael
|
Fixed. Pleasedownload the latest package.
BTW, you should consider user " or [] to enclosing your column name, since maybe it contains space in CSV file header.
System.out.println(tableName + ".\"" + column+"\"");
System.out.println(tableName + ".[" + column+"]");
|