Subject | Re: [Firebird-Java] Returning Clause..... :( |
---|---|
Author | Adilson R. Fernandes |
Post date | 2008-08-26T18:20:13Z |
...
String sql = "insert into Test (name) values (?) returning id";
FirebirdPreparedStatement stat =
(FirebirdPreparedStatement)conn.prepareStatement(sql);
try {
stat.setString(1, "Test");
ResultSet rs = stat.executeQuery();
try {
if (rs.next()) {
System.out.println(rs.getInt("id"));
}
} finally {
rs.close();
rs = null;
}
conn.commit();
} finally {
stat.close();
stat = null;
}
...
Adilson.
Cleberson B. Alano escreveu:
String sql = "insert into Test (name) values (?) returning id";
FirebirdPreparedStatement stat =
(FirebirdPreparedStatement)conn.prepareStatement(sql);
try {
stat.setString(1, "Test");
ResultSet rs = stat.executeQuery();
try {
if (rs.next()) {
System.out.println(rs.getInt("id"));
}
} finally {
rs.close();
rs = null;
}
conn.commit();
} finally {
stat.close();
stat = null;
}
...
Adilson.
Cleberson B. Alano escreveu:
> How can I use the "returning clause" inserting data ?[Non-text portions of this message have been removed]
> The "executeUpdade" return a Result Set ?
> I search in the web for examples but I´m not found yet !
> Someboby can help me ?
>
> Jaybird 2.1.6
> FireBird 2.1.0.1
>
> Thanks
>