I'm evaluating the CSV driver, and am getting a NoSuchMethodException. Here's my code:
Class.forName("com.hxtt.sql.text.TextDriver");
String sql = "select * from test";
String url = "jdbc:csv:///" + "/Users/tobin/Desktop/contact list.csv";
Properties props = new Properties();
props.put("_CSV_Header", "true");
Connection conn = DriverManager.getConnection(url, props);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
System.out.println(rs.getObject("First Name") + " " + rs.getObject("Last Name") + " - " + rs.getObject("Email sddress"));
}
rs.close();
stmt.close();
conn.close();
And here are the contents of /Users/tobin/Desktop/contact list.csv:
"First Name","Last Name","Email Address"
"Steve","Jobs","steve@apple.com"
"Bill","Gates","bill@microsoft.com"
Finally, here's is the stack trace that I'm getting:
Exception in thread "main" java.lang.NoSuchMethodError: com.hxtt.sql.de.a(ILjava/lang/String;Ljava/util/Properties;)Lcom/hxtt/concurrent/aa;
at com.hxtt.sql.text.EmbeddedDriver.connect(Unknown Source)
at com.hxtt.global.SQLState.getConnection(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at Test.readCSV(Test.java:118)
at Test.main(Test.java:55)
Line 118 of my Text class is the "Connection conn = DriverManager.getConnection(url, props);" line.
What am I doing wrong? Thanks.
Tobin
|
Please check whether you're using more than one kind HXTT package in your classpath. It should be resulted by mixed one old HXTT package with one new HXTT package. You should download those packages on the same day.
|
Great, that worked. We are also using the Excel driver. Thanks.
|