Subject Re: [Firebird-Java] Re: how to insert??
Author Daniel Bertin
Thanks

What does the ? do.
(VALUES ?, 'NOW', ?)




At 03:31 PM 7/31/2003 +0000, you wrote:
> > How do I insert a java variable with jaybird? :variable gives me an
> > error
> >
> > INSERT INTO TABLE (FIELD1,DATEFIELD2,FIELD3)
> > VALUES (:variable1,'NOW', :variable2)
> >
>
>If you use java.sql.PreparedStatement, use following:
>
>PreparedStatement stmt = con.prepareStatement(
> "INSERT INTO my_table(field1, datefield2, field3) " +
> "VALUES (?, 'NOW', ?)");
>
>stmt.setString(1, someValueOfTheField1);
>stmt.setInt(2, someValueOfTheField3);
>
>stmt.excecute(); // or stmt.executeUpdate();
>
>Best regards,
>Roman Rokytskyy
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
><http://rd.yahoo.com/M=256694.3651271.4917408.1261774/D=egroupweb/S=1705006764:HM/A=1688501/R=0/SIG=11if1rb57/*http://webevents.yahoo.com/universal/seabiscuit/>2a5e1d68.jpg
>
>2a5e1de5.jpg
>
>To unsubscribe from this group, send an email to:
>Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.