Intanto grazie per la risposta, ho fatto l'upload del file mysql-connector-java-5.1.18-bin.jar nella cartella WEB-INF/lib, e fin qui tutto ok
la connessione non avviene con successo, e non so perche!!! con lo stesso codice, in locale è tutto ok, ma sull'host aruba niente... posto il codice, per chi mi vuole aiutare!!!!
questo è il codice che in locale fuinziona, ma sull'host artera niente!!!
codice:
<%
java.sql.Connection con = null;
String password = "xxxxxxxxx";
String user = "xxxxxxxx";
String stringConnection = "jdbc:mysql://localhost:3306/xxxxxxxxxxxxx";
java.sql.ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection(stringConnection, user, password);
java.sql.Statement st = con.createStatement();
rs = st.executeQuery("SELECT * FROM prova");
while (rs.next()) {
out.print("
" + rs.getString("nome"));
out.print("
" + rs.getString("cognome") + "
");
}
%>
il risultato di questo codice è il seguente:
codice:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /index.jsp:27
24:
25: Class.forName("com.mysql.jdbc.Driver");
26:
27: con = DriverManager.getConnection(stringConnection, user, password);
28: java.sql.Statement st = con.createStatement();
29:
30: rs = st.executeQuery("SELECT * FROM prova");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:489)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
javax.servlet.ServletException: Access denied for user 'xxxxxxxxxxxx'@'localhost' (using password: YES)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.index_jsp._jspService(index_jsp.java:85)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.sql.SQLException: Access denied for user 'xxxxxxxxxxx'@'localhost' (using password: YES)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:943)
com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4113)
com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
java.sql.DriverManager.getConnection(DriverManager.java:582)
java.sql.DriverManager.getConnection(DriverManager.java:185)
org.apache.jsp.index_jsp._jspService(index_jsp.java:67)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.30 logs.
ringrazio anticipatamente chi mi aiuta!!!!