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

prepared statement in jdbc

 
raja maharaja
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam getting two errors in this code
one is at prepared sttement object
and the other at pst.executeUpdate()
these two errors are coming at lines 52 & 72 of the below code
here in this code whenever the result of ping is "request timed out " iam storing the date of that in the database and that iam doing with prepared statememt object.
but it is showing error at those two lines.

please tell me what mistake i have done???

 
Campbell Ritchie
Sheriff
Pie
Posts: 47292
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what are the errors? Are they compile-time or run-time errors? Look through the Connection interface and check the names of all methods very carefully.
 
raja maharaja
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:And what are the errors? Are they compile-time or run-time errors? Look through the Connection interface and check the names of all methods very carefully.





two errrors are compiletime errors

and these are the errors


please tell me what mistake i have done , i wrote syntax correctly, please check
 
Campbell Ritchie
Sheriff
Pie
Posts: 47292
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have a pst variable anywhere in scope at that time. And I have already given a hint about the other error.
 
raja maharaja
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:You don't have a pst variable anywhere in scope at that time. And I have already given a hint about the other error.




ya i have resolved that error,but now one error left


please tell me what i should do to correct this error
 
Campbell Ritchie
Sheriff
Pie
Posts: 47292
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a new error, caused by your adding an unnecessary throws declaration (in the wrong place).
 
raja maharaja
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:That is a new error, caused by your adding an unnecessary throws declaration (in the wrong place).



but if i remove that throws declaration from there ,iam getting some more errors.
please tell me what i can do to remove thsi error.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
raja maharaja wrote:but if i remove that throws declaration from there ,iam getting some more errors.

Right. It's trying to tell you something. The typical form for JDBC code is:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic