I use the CREATE TABLE statement, but when I want to read data the error message "The table structure of Text Table C:\Temp\db\appli.BIN is unknown. Please use CREATE TABLE to define a table structure once."
my code :
Class.forName("com.hxtt.sql.text.TextDriver");
Connection c = DriverManager.getConnection("jdbc:text:/c:/temp/db");
Statement stmt = c.createStatement();
stmt.execute("CREATE TABLE appli (appli VARCHAR (10) NOT NULL, text VARCHAR (30), PRIMARY KEY (appli));");
stmt.close();
c.close();
For reading data
Class.forName(com.hxtt.sql.text.TextDriver);
Connection conn = DriverManager.getConnection("jdbc:text:/c:/temp/db");
Statement stmt = conn.createStatement();
try {
ResultSet rs = stmt.executeQuery("SELECT screenspat FROM release");
} catch (SQLException ex) {
ex.printStackTrace();//Here is the Exception
}
Is there an explanation ?
Thanks for ALL
JW EVEREST
Lefebvre Software
40, Bd de Hambourg
13008 Marseille
|
>Is there an explanation ?
If you use text, you need to call "CREATE TABLE appli (appli VARCHAR (10) NOT NULL, text VARCHAR (30), PRIMARY KEY (appli));")" again, since that table structure won't be stored.
>Connection c = DriverManager.getConnection("jdbc:text:/c:/temp/db");
You can use Connection c = DriverManager.getConnection("jdbc:csv:/c:/temp/db?_CSV_Header=true"); then your code will work, since csv can store your table information
|