wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Insert  record to table with  the help of Sequence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Insert  record to table with  the help of Sequence" Watch "Insert  record to table with  the help of Sequence" New topic
Author

Insert record to table with the help of Sequence

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

I have pasted a small amount of code of my BankProject ...
i really don't know what is wrong with my code(unable to insert data into table). // i need to insert data periodically with help of sequence bc.seq but it's not possible to do with that .... is something wrong with my code



Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

ItDoesntWorkIsUseless. Please tell us why you're unable to insert the data? What goes wrong?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Wouter Oet wrote:ItDoesntWorkIsUseless. Please tell us why you're unable to insert the data? What goes wrong?


Thanks Wouter Oet, i'm getting a blank screen...after i give values.



rather it should say Succesfully Updated ...instead i'm getting a blank empty web page.
Sudipta Laha
Ranch Hand

Joined: Aug 23, 2010
Posts: 49
Please check the api http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Statement.html#execute(java.lang.String)

its only true when its returns a resultset object


Regards,
Sudipta Kumar Laha
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Sudipta Laha wrote:Please check the api http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Statement.html#execute(java.lang.String)

its only true when its returns a resultset object


Thank you ,i've corrected it ... but still i get the blank page as Answer.
Sudipta Laha
Ranch Hand

Joined: Aug 23, 2010
Posts: 49
Hi
try statement.executeUpdate(string).. it will return a int. Give a SOP to check the integer value.
If its 0 insert has not happened.
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Sudipta Laha wrote:Hi
try statement.executeUpdate(string).. it will return a int. Give a SOP to check the integer value.
If its 0 insert has not happened.


it's just the blank screen what i get ...and in console(server ) neither 0/1 gets printed.
Sudipta Laha
Ranch Hand

Joined: Aug 23, 2010
Posts: 49
Hi,

If you are not getting 0/1(ie.. nothing is comming in console), your code is breaking before that.

Give SOP before that also and check whether this file is getting called correctly/in which part the code is breaking.
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

In console nothing is getting printed before or After.
Sudipta Laha
Ranch Hand

Joined: Aug 23, 2010
Posts: 49
you need to debug the whole issue... from the place you are calling the file.
Atleast the file should get called properly, then there may be issues with code that can be corrected. But atleast this code should get called.
 
wood burning stoves
 
subject: Insert record to table with the help of Sequence
 
Similar Threads
jsp and jdbc
Struts2MySQL
Getting null values in table even after the input
Problem in inserting data into oracle db from jsp
JSP with Jdbc