Re: [INTERFACES] Problem with PreparedStatement
От | Oliver Elphick |
---|---|
Тема | Re: [INTERFACES] Problem with PreparedStatement |
Дата | |
Msg-id | 199910181822.TAA00590@linda.lfix.co.uk обсуждение исходный текст |
Ответ на | Problem with PreparedStatement ("Esteban Chiner Sanz" <echiner@tissat.es>) |
Список | pgsql-interfaces |
"Esteban Chiner Sanz" wrote: >I'm trying to do this: > >if (counter != -1) /* No ha habido ningún error */ > {> PreparedStatement pstmt=null; > sql="insert into tar_historico values (?,?,?)"; > razon="<br>Query: " + sql; > try { > pstmt = con.prepareStatement(sql); > pstmt.setString(1,Integer.toString(counter)); > pstmt.setString(2,"1"); > pstmt.setTimestamp(3,new Timestamp(new >java.util.Date().getTime())); > pstmt.executeUpdate(sql);> pstmt.close(); > con.close(); > } > >ButI get this error message in the PostgreSQL log: > > query: insert into tar_historico values (?,?,?) > ERROR: parser:parse error at or near "," > >What could be the problem? I've tried everything and I haven't found the >solution yet.Please, help. >Thanks in advance, How about: sql="insert into tar_historico values ('?','?','?')"; -- Vote against SPAM: http://www.politik-digital.de/spam/ ======================================== Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID32B8FAA1 ======================================== "Delight thyself also in the LORD; and he shall give thee the desires of thine heart." Psalms 37:4
В списке pgsql-interfaces по дате отправления: