M
Mongoose
Hi,
I am trying to retrieve the primary key from a newly inserted row in
an Oracle Database from a JSF application. However, when I execute
this line:
Integer x = rs1.getInt("PurchaseID");
in the code below I get an SQLException "Unsupported Feature". I'm
using Oracle Database 10g and ojdbc14.jar.
Could be a jdbc driver problem but I'm not sure. Could someone help
me out here??
Thanks so much,
Andy
Statement stmt2 = conn.createStatement();
SQLStatement1 = new StringBuffer("INSERT INTO Purchase (PurchaseID,
CarModelID) VALUES (");
SQLStatement1.append("PurchaseID_Seq.nextval, ");
SQLStatement1.append(ModID + ")");
stmt2.executeUpdate(SQLStatement1.toString(),
Statement.RETURN_GENERATED_KEYS);
ResultSet rs1 = stmt2.getGeneratedKeys();
if (rs1.next())
{
Integer x = rs1.getInt("PurchaseID");
}
I am trying to retrieve the primary key from a newly inserted row in
an Oracle Database from a JSF application. However, when I execute
this line:
Integer x = rs1.getInt("PurchaseID");
in the code below I get an SQLException "Unsupported Feature". I'm
using Oracle Database 10g and ojdbc14.jar.
Could be a jdbc driver problem but I'm not sure. Could someone help
me out here??
Thanks so much,
Andy
Statement stmt2 = conn.createStatement();
SQLStatement1 = new StringBuffer("INSERT INTO Purchase (PurchaseID,
CarModelID) VALUES (");
SQLStatement1.append("PurchaseID_Seq.nextval, ");
SQLStatement1.append(ModID + ")");
stmt2.executeUpdate(SQLStatement1.toString(),
Statement.RETURN_GENERATED_KEYS);
ResultSet rs1 = stmt2.getGeneratedKeys();
if (rs1.next())
{
Integer x = rs1.getInt("PurchaseID");
}