Error is: Generated keys not requested.

Ads

 
 

Share on Google+Share on Google+

Java Coder
Error is: Generated keys not requested.
1 Answer(s)      4 years and 9 months ago
Posted in : Java Beginners

Hi,

Following error is coming in my program.

Error is: Generated keys not requested. You need to specify Statement.RETURNGENERATEDKEYS to Statement.executeUpdate() or Connection.prepareStatement().

What could be solutions

Thanks

Ads
View Answers

January 14, 2013 at 9:28 PM


Hi,

You should add the following code in your program:

PreparedStatement pstmtInsert  = 
conn.prepareStatement(queryInsert,Statement.RETURN_GENERATED_KEYS);

Thanks


Ads









Related Tutorials/Questions & Answers:
Error is: Generated keys not requested.
Error is: Generated keys not requested.   Hi, Following error is coming in my program. Error is: Generated keys not requested. You need to specify... = conn.prepareStatement(queryInsert,Statement.RETURN_GENERATED_KEYS); Thanks
error http status-500 invalid path was requested
error http status-500 invalid path was requested  I am using netbeans 6.8 + struts 1.3 + glassfish v3.I am not able to open add.jspx which contains add form.please help. index.jsp [code] <%@page contentType
Advertisements
error http status-500 invalid path was requested
error http status-500 invalid path was requested  I am using netbeans 6.8 + struts 1.3 + glassfish v3.I am not able to open add.jspx which contains add form.please help. index.jsp [code] <%@page contentType
error http status-500 invalid path was requested
error http status-500 invalid path was requested  I am using netbeans 6.8 + struts 1.3 + glassfish v3.I am not able to open add.jspx which contains add form.please help. index.jsp [code] <%@page contentType
error http status-500 invalid path was requested
error http status-500 invalid path was requested  I am using netbeans 6.8 + struts 1.3 + glassfish v3.I am not able to open add.jspx which contains add form.please help. index.jsp [code] <%@page contentType
setting keys
setting keys  Hi Sir\Mam,At present we are doing Payroll Project .I would like to set some special keys for my forms and i want the coding to do the same .Pls Provide me source code for setting keys as soon as possible
Generate Keys
Generate Keys  hello i need code to generate key , after that send Keys to email address user. for example if you member in your website,if member not having Secret Keys not can download files if member having secret key i
Keys in DBMS
Keys in DBMS  Whats the main difference between composite and super keys   Difference between super key and composite key: A super key... in a table while composite key is the combination of two or more than two keys
Detecting Duplicate Keys
Detecting Duplicate Keys  Detecting Duplicate Keys I have a program... to display an error message by processing the error code from the database. How can I capture this error code in a Java program
Version of com.datomic>s3-access-keys dependency
List of Version of com.datomic>s3-access-keys dependency
Version of com.noodlesandwich>rekord-keys dependency
List of Version of com.noodlesandwich>rekord-keys dependency
Version of com.noodlesandwich>rekord-keys dependency
List of Version of com.noodlesandwich>rekord-keys dependency
PHP list array keys
array_keys() function returns the keys of the the given array. It returns the keys in the form of array. Example of PHP list Array Keys <?php...;   $key=array_keys($ar1);     print_r($key); ?>
Error - Java Beginners
Error  How to rectify requested resource()not found . HTTp-404 error
error
error  while iam compiling iam getting expected error
how to create customise shortcut keys in jsp?
how to create customise shortcut keys in jsp?  I want to use shortcut keys in my application. keys like' EX: 1)S-Slag 2)ex-Exposure etc
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
Get information about foreign keys used in a table.
Get information about foreign keys used in a table.  How can I get information about foreign keys used in a table
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
Error
Error  I have created ajax with php for state and city. When I change state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld
Maven Dependency s3-access-keys >> 0.1.4
You should include the dependency code given in this page to add Maven Dependency of com.datomic >> s3-access-keys version0.1.4 in your project
Maven Dependency s3-access-keys >> 0.1.6
You should include the dependency code given in this page to add Maven Dependency of com.datomic >> s3-access-keys version0.1.6 in your project
Maven Dependency rekord-keys >> 0.3
You should include the dependency code given in this page to add Maven Dependency of com.noodlesandwich >> rekord-keys version0.3 in your project
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText