Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Error is: Generated keys not requested.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
Error is: Generated keys not requested.
1 Answer(s)      a year 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


Advertisement
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



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
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
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
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
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); ?>
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
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
get information about foreign keys - JDBC
get information about foreign keys  How to get the information about foreign keys in Java
JSlider disabling sliding through arrow keys
JSlider disabling sliding through arrow keys  I want that JSlider should not moved by using arrow keys. Is it possible? then guide me please.   Please visit the following links: http://www.roseindia.net/java/example
SimpleJdbcInsert, Retrieving auto-generated keys
SimpleJdbcInsert, Retrieving auto-generated keys The auto-generated keys can be generated using "usingGeneratedKeyColumns" method. The name of the auto generated key column can be specified by passing it's name to method
Error - Java Beginners
Error  How to rectify requested resource()not found . HTTp-404 error
Reading duplicate keys from .properties file - Development process
Reading duplicate keys from .properties file  Hi, I am reading... will not allow duplicate keys, but still I want to develope a program to identify the duplicate keys and print it on console. It is urgent requirement,please reply
I determine where a given table is referenced via foreign keys.
I determine where a given table is referenced via foreign keys.  How can I determine where a given table is referenced via foreign keys
Write the Keys and Values of the Properties files in Java
Write the Keys and Values of the Properties files in Java... will learn how to add the keys and it's values of the properties files in Java. You know the properties files have the the keys and values of the properties files
error
error  while iam compiling iam getting expected error
Get All Keys and Values of the Properties files in Java
Get All Keys and Values of the Properties files in Java... how to get all keys and it's values of the properties files in Java. Java provides the features to collection of all keys and values of the properties file
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
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
Get All Keys and Values of the Properties files in Java
Get All Keys and Values of the Properties files in Java... to get all keys and values of the properties files in the Java. This section illustrates the way for getting all keys and corresponding values of the properties
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
How to get Keys and Values from HashMap in Java?
How to get Keys and Values from HashMap in Java? Example program of iterating... to iterate the keys and get the values and print on the console. How to get keys... to iterate through keys and get the values. So, let's see how to iterate
error
error
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  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
 

 

 

DMCA.com