Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-2007, 10:56 AM
Metallion Metallion is offline
Newbie
 
Join Date: May 2007
Posts: 2
Rep Power: 0
Metallion is on a distinguished road
Default hsqldb problem

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,'',tr ue);

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_INSENSI TIVE,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);
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 07:46 AM
i have a problem please help me!!!???? stack Java Help 8 09-22-2007 03:17 PM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 04:58 AM
Having a problem with a relatively easy problem... Yaglana Java Help 0 04-26-2007 07:33 PM
A small problem in the output The_Master C and C++ 3 12-13-2006 12:04 PM


All times are GMT -5. The time now is 08:22 AM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 66%

Ads