Inserting data into a postgres table using java

Поиск
Список
Период
Сортировка
От suhail sarwar
Тема Inserting data into a postgres table using java
Дата
Msg-id PM.6715.988461486@pmweb8.uk1.bibliotech.net
обсуждение исходный текст
Список pgsql-novice
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



В списке pgsql-novice по дате отправления:

Предыдущее
От: tompoe
Дата:
Сообщение: Re: install question
Следующее
От: "suhail sarwar"
Дата:
Сообщение: Attribute 'name' not found ERROR for postgres and java