Thread: Inserting data into a postgres table using java

Inserting data into a postgres table using java

From
"suhail sarwar"
Date:
Hi,

 I am having problems inserting data into a postgres table created using java. The create table part of the code works
fine,its only when I am inserting values into the table that nothing happens. The code I am using to populate the table
Test1is: 

PreparedStatement stt = db.prepareStatement("INSERT INTO Test1 " + "VALUES (100, name, 55)");
stt.executeUpdate();

The code for creating the table is:
PreparedStatement st = db.prepareStatement("CREATE TABLE Test1 " + "(CUS_NO INTEGER, NAME VARCHAR(20), AGE INTEGER)");
ResultSet rs = st.executeQuery();

I don't know why the data does not get inserted into the table, even though the table gets created.

Any Ideas??

Kind Regards

Sarwar