how to delete entry in a database through java servlet run in eclipse??
Hello , I need help editing this java code which aims to delete an entry from a database run by mysql. this code will be run through eclipse. I already tried to edit and made sure all variable names and types were correct but it just would not work. Please help! thanks a lot!!!
public String delResolution(int id)
ConMan con = new ConMan();
Statement stmt = con.logOn().createStatement();
String msg = "";
String sql = "delete from ledger where id="+id;
msg = "Delete failed";
msg = "Delete successfully";
catch (SQLException e)
return "Delete. SQL error " + e.getMessage();
catch (java.lang.NullPointerException ne)
return "<p>Null error: " + ne.getMessage();
Welcome to DevX
Does it return an error or just not work?
(Also, please do not post duplicate threads in different sections for the same question. Thanks. )
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
By Arjuna in forum Database
Last Post: 07-25-2007, 03:22 AM
Last Post: 10-17-2005, 11:51 PM
Last Post: 05-13-2005, 06:46 AM
By Glen Kunene in forum Talk to the Editors
Last Post: 03-23-2002, 12:43 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL