*
The moose likes JDBC and the fly likes problem with my insert data page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with my insert data page" Watch "problem with my insert data page" New topic
Author

problem with my insert data page

albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108


suppose the program will check whether the attendday < barClass if yes insert into the database. it should be more than 1 data will be insert. but when run this page error come out "Operation not allowed after ResultSet closed" juz 1 data been insert into database. is it my coding problem and how i gotta to solve my problem??


JAVA the only can called technology
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

is it my coding problem and how i gotta to solve my problem??

Use a new Statement.

And don't forget to close Statments as well. We usually put all the boring close() stuff in the finally close, to make sure that everything is cleaned even when an exception occurs.


[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

Please be sure to post in the appropriate forum. This is a JDBC question even if it is being performed inappropriately in a JSP page. This topic has been moved to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
albert sie
Ranch Hand

Joined: Jan 15, 2006
Posts: 108
how to using new statement?
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Albert,

Satou probably means:

Statement anotherStatement = C.createStatement();
anotherStatement.executeUpdate(...);

Herman
PS: I'm really curious why you do all the JDBC-code in a page
(it's usually considered as BAD)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with my insert data page
 
Similar Threads
JSP program error
problem with my page
jsp & database
reading data from jsp page to another jsp page using request.getParameter
headache can someone help me in this