tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: Msql Connector/J
Date Wed, 09 May 2007 20:37:56 GMT
you and sven need to search thru the mostly nonexistent MySQL documentation 
on how to
start MYSQLd
create a user (other than null@localhost)
create DATABASE
create TABLE in DATABASE
turn on INNODB

the MySQL documentation is pretty much nonexistent so you and sven should 
have lots of fun

M-

GL
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Massimiliano PASQUALONI" <massimiliano.pasqualoni@data-processing.it>
To: <users@tomcat.apache.org>
Sent: Wednesday, May 09, 2007 11:59 AM
Subject: Msql Connector/J


> Hi everybody!
>
> I'ved downloaded mysql-connector-java-5.1.0.zip.
>
> I'ved put the mysql-connector-java-5.1.0-bin.jar in
> C:\Programmi\Java\jre1.6.0_01\lib and I'ved set the %CALSSPATH% on the 
> same
> directory.
>
>
> I'ved create a jsp page:
>
>
> <%@ page import="java.sql.*" %>
> <%
> String connectionURL =
> "jdbc:mysql://localhost:3306/bi?user=USER;password=PASSWORD";
> Connection connection = null;
> Statement statement = null;
> ResultSet rs = null;
> %>
> <html><body>
> <%
> Class.forName("com.mysql.jdbc.Driver").newInstance();
> connection = DriverManager.getConnection(connectionURL, "", "");
> statement = connection.createStatement();
> rs = statement.executeQuery("SELECT * FROM  TABLE WHERE username='ciao' 
> and
> password='ciao' and Abilitato = 1");
> while (rs.next()) {
> out.println(rs.getString("username")+"<br>");
> }
> rs.close();
> %>
>
>
> Tomcat send me an 500 error:
>
>
> 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: /prova.jsp:14
>
>
>
> 11: <html><body>
>
> 12:
>
> 13: <%
>
> 14: Class.forName("com.mysql.jdbc.Driver").newInstance();
>
> 15: connection = DriverManager.getConnection(connectionURL, "", "");
>
> 16: statement = connection.createStatement();
>
> 17: rs = statement.executeQuery("SELECT * FROM ANAG_UTENTI WHERE
> username='ciao' and password='ciao' and Abilitato = 1");
>
>
>
>
>
> Stacktrace:
>
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
> pper.java:467)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 71)
>
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
> root cause
>
> javax.servlet.ServletException: com.mysql.jdbc.Driver
>
>
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
> mpl.java:846)
>
>
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:779)
>
> org.apache.jsp.prova_jsp._jspService(prova_jsp.java:79)
>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 28)
>
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
> root cause
>
> java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1359)
>
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
> a:1205)
>
>
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
>
>
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
>
> java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> java.lang.Class.forName0(Native Method)
>
> java.lang.Class.forName(Unknown Source)
>
> org.apache.jsp.prova_jsp._jspService(prova_jsp.java:57)
>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
> 28)
>
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>
> 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.
>
>
>
> It's the connector don't work?
>
>
> Thanks!!!
>
>
> Massimiliano PASQUALONI
>
> Data Processing S.r.l.
> Reparto EDP
> S.S. 100 BA-TA Km 18
> c/o "IL BARICENTRO"
> torre D
> 70010 CASAMASSIMA (BA)
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message