This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with my insert data page

 
albert sie
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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??
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
albert sie
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to using new statement?
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic