wood burning stoves*
The moose likes JDBC and the fly likes Query Correct, but not functioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Query Correct, but not functioning" Watch "Query Correct, but not functioning" New topic
Author

Query Correct, but not functioning

Michael Paul
Greenhorn

Joined: Mar 29, 2008
Posts: 14
Hi,

I am trying to write to a DB from my code however the data is not writing to the database. I ran the SQL statement through the DB Frontend that I use and it worked, however through my code it does not work. Here is the snippit:




Any help at all would be appreciated, I am very stumped,

Atreides
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

"Atreides", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459



But how would you know if anything was failing?
Michael Paul
Greenhorn

Joined: Mar 29, 2008
Posts: 14
I did a printStackTrace, and it said I couldn't use "executeQuery" to manipulate data. So I used executeUpdate and it worked, thanks for reminding me to do a printstacktrace, i was being dumb, thanks again!

Michael
[ April 16, 2008: Message edited by: Michael Paul ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Yes, you ninny :P

Although keep in mind that printStackTrace doesn't count as 'handling the exception' either, but it's one step better than swallowing it without comment.
 
Don't get me started about those stupid light bulbs.
 
subject: Query Correct, but not functioning
 
Similar Threads
Can't write UTF8 chars
update to database problem
I hope someone replies to this one
Error while inserting data through procedure
Data type mapping issue