Hi
I have a problem with the HSQLDB database engine. The thing is that it just refuses to put anything in my database. It doesn't give me any errors but simply nothing ends up in the database.
This is my sql query: Insert into tblStatusChanges (menuOutput,battleOutput,succesrate,timed,time,att,amount,element,type) Values('werwerwe','werwerwer',5,false,0,'',0,'',true);
for this table:
sql = "CREATE TABLE tblStatusChanges ("
+ "ID int IDENTITY,"
+ "menuOutput char(255),"
+ "battleOutput char(255),"
+ "succesrate int,"
+ "timed boolean,"
+ "time int,"
+ "att char(50),"
+ "amount int,"
+ "element char(255),"
+ "type boolean,"
+ "primary key (ID));";
If anyone could help my i'd be very grateful.
Below's the code i'm using. I'm trying to execute my insert query using the update function.
public class DBDriver {
private Connection conn;
private Statement st;
// we dont want this garbage collected until we are done
public DBDriver(String db_file_name_prefix) throws Exception {
Class.forName("org.hsqldb.jdbcDriver");
conn = DriverManager.getConnection("jdbc:hsqldb:"
+ db_file_name_prefix, // filenames
"sa", // username
""); // password
st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
//use for SQL commands CREATE, DROP, INSERT and UPDATE
public synchronized void update(String expression) throws SQLException {
if (st.executeUpdate(expression) == -1) {
System.out.println("database error : " + expression);
}
}
}
hsqldb problem
Started by
Guest_Metallion_*
, Jun 08 2007 07:56 AM
No replies to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Guest_Metallion_*
Back to top









