It's not a secret anymore!*
The moose likes JDBC and the fly likes MySQL Connector/J 2.0.14 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL Connector/J 2.0.14" Watch "MySQL Connector/J 2.0.14" New topic
Author

MySQL Connector/J 2.0.14

Niklas Persson
Greenhorn

Joined: Sep 08, 2002
Posts: 1
Hello !
I have some problem when I try to use Mysql and java server pages.
My test page, test.jsp:
<%
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
java.sql.Connection conn;
conn = java.sql.DriverManager.getConnection(
"jdbc:mysql://localhost/adressbok?user=root&password=");
java.sql.Statement s = conn.createStatement();
java.sql.ResultSet rs = s.executeQuery("select strEname, strFname from tbl_contacts");
while(rs.next()) {
out.println(rs.getString("strEname") + " = "
+ rs.getString("strFname") + "<BR>");
}
%>
From this code I get the following errors:
javax.servlet.ServletException: org.gjt.mm.mysql.Driver
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.test$jsp._jspService(test$jsp.java:76)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
-----
Any suggestions or did any one come across this kind of problem before ?

Thanks for any help
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"quazzo",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL Connector/J 2.0.14