the problem is:-
i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem...
when i enter values in the 2 text boxes and click enter an exception occours which is-
Expand|Select|Wrap|Line Numbers
- type Exception report
- message
- description The server encountered an internal error () that prevented it from fulfilling this request.
- exception
- javax.servlet.ServletException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
- org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
- org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
- org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
- org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
- org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
- javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
- javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
- root cause
- com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
- com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
- com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
- com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
- com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
- com.mysql.jdbc.Connection.execSQL(Connection.java:3250)
- com.mysql.jdbc.Statement.executeUpdate(Statement.java:1355)
- com.mysql.jdbc.Statement.executeUpdate(Statement.java:1270)
- org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:225)
- publicity.UpBdgtAction.execute(UpBdgtAction.java:52)
- org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
- org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
- org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
- org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
- javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
- javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
- note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
- --------------------------------------------------------------------------------
- Apache Tomcat/5.5.23
herz my sql query which is in my class:-
Expand|Select|Wrap|Line Numbers
- String s8 = "INSERT INTO Budget_Master(Branch,Publicity_Code,Budget_Alloted,Work_In_Progress,Amount_Paid) VALUES (?,?,?,?,?)";
- String s9 = "update budget_master set old_budget = budget_alloted where branch='" + s3 + "' and publicity_Code=" + s4;
- String s10 = "UPDATE Budget_Master set budget_alloted=" + s5 + " where Branch='" + s3 + "' and publicity_Code=" + s4;
regards,
ajos