Cita:
Contexto de la consulta:st.executeUpdate("INSERT INTO videos (nombre, direccion, comentario) VALUES ('" + nombre + "','" + direccion + "','"+ comentario +"')");
Cita:
Error que escupe el log de Apache Tomcat:import servlets.*;
import jbs.*;
import java.io.*;
import java.sql.*;
public class modificar_datos implements Serializable {
conexion con = new conexion();
Statement st;
public void insertVideos(String login, String password, String nombre, String direccion, String comentario)throws SQLException{
con.conectar(login, password);
st = con.miConexion().createStatement();
st.executeUpdate("INSERT INTO videos (nombre, direccion, comentario) VALUES ('" + nombre + "','" + direccion + "','"+ comentario +"')");
}
import jbs.*;
import java.io.*;
import java.sql.*;
public class modificar_datos implements Serializable {
conexion con = new conexion();
Statement st;
public void insertVideos(String login, String password, String nombre, String direccion, String comentario)throws SQLException{
con.conectar(login, password);
st = con.miConexion().createStatement();
st.executeUpdate("INSERT INTO videos (nombre, direccion, comentario) VALUES ('" + nombre + "','" + direccion + "','"+ comentario +"')");
}
Cita:
Si alguien me puede ayudar se lo agradeceria. 16-dic-2007 20:38:23 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() para servlet jsp lanzó excepción
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: INSERT command denied to user 'admin'@'localhost' for table 'videos'
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:40 6)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:18 37)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2537)
at com.mysql.jdbc.StatementImpl.executeUpdate(Stateme ntImpl.java:1564)
at com.mysql.jdbc.StatementImpl.executeUpdate(Stateme ntImpl.java:1485)
at jbs.modificar_datos.insertVideos(modificar_datos.j ava:24)
at org.apache.jsp.inserccion_jsp._jspService(insercci on_jsp.java:81)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
GRAVE: Servlet.service() para servlet jsp lanzó excepción
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: INSERT command denied to user 'admin'@'localhost' for table 'videos'
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:40 6)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:18 37)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2537)
at com.mysql.jdbc.StatementImpl.executeUpdate(Stateme ntImpl.java:1564)
at com.mysql.jdbc.StatementImpl.executeUpdate(Stateme ntImpl.java:1485)
at jbs.modificar_datos.insertVideos(modificar_datos.j ava:24)
at org.apache.jsp.inserccion_jsp._jspService(insercci on_jsp.java:81)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)