Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
JDBC and Relational Databases
Reopening the thread which I marked as Resolved by mistake!
Pranit Sonawane
Ranch Hand
Posts: 172
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all. First of all I'm sorry for unknowingly making a mistake of marking my previous issue as resolved as I have reopen it.
try { Class.forName("com.mysql.jdbc.Driver"); Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mnpac?charset=UTF-8", "root", "pranit"); PreparedStatement ps = cn.prepareStatement("select * from opbal"); ResultSet rs = ps.executeQuery(); rs.beforeFirst(); String fon, fov = ""; while (rs.next()) { fon = rs.getString("name"); fov = rs.getString("vibhag"); out.println(fon+" = "fov+"<br>"); PreparedStatement ps1 = cn.prepareStatement("update salaries set vibhag = '" + fov + "' where name = '" + fon + "'"); ps1.executeUpdate(); } } catch (Exception e) { out.println(e.getMessage()); }
Above was the code which I posted in my earlier
thread
as the record is not updating. I tried making changes such as
int i = ps1.executeupdate(); System.out.println(i);
which prints
"1"
as a result and in actual the query doesn't update the column's value!
Please help me its getting really tricky for me!
Many thanks!
Maneesh Godbole
Bartender
Posts: 11497
19
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Marking as resolved does not 'lock' the topic. You can still continue the discussion in it
https://coderanch.com/t/641452/JDBC/databases/update-query-doesn-run
Locking this one, so that all relevant discussion stays in one place
[
How to ask questions
] [
Donate a pint, save a life!
] [
Onff-turn it on!
]
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
While Loop Does Not Run!
Column can not be null
This question is simple still not able to figure out what the issue is!
Searching data using NON English Language Words Doesn't Work!
More...