Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

preparedStatement with like where clause

 
peter tong
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my preparedStatement is

this query can return record if I run in Oracle sql developer, but no if in java (no record return and no error), what is the reason?
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any problem with it. Could you post (copy&paste) the command you run in SQL Developer and the records it produced?
 
peter tong
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Vajsar wrote:I don't see any problem with it. Could you post (copy&paste) the command you run in SQL Developer and the records it produced?


thanks for your reply, I am not in office now, but the command run successfully in SQL Developer, but not in JDBC preparestatement, in JDBC preparestatement, it returns no record.
 
peter tong
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Vajsar wrote:I don't see any problem with it. Could you post (copy&paste) the command you run in SQL Developer and the records it produced?




from the attachment, if the sql is run in Oracle sql developer, there is 6 records retrieved, but if use preparedstatement, no record can be retrieved, what is the problem from?
TestLike.jpg
[Thumbnail for TestLike.jpg]
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The image you posted appears to be from about three weeks ago (what look like log entries at the bottom are dated February 27). Perhaps the database has changed since then?
 
peter tong
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the problem finally, the oracle sql developer need run commit after update sql is run.
 
Wendy Gibbons
Bartender
Posts: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bother those pesky transactions. always one to look out for.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic