File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Help Me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Help Me" Watch "Help Me" New topic
Author

Help Me

Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
i'm using Mysql and i have downloaded the jdbc for it. I have set the classpath and eveything but i keep getting a error message:
org.apache.jasper.JasperException: Unable to compile class for JSPC:\Tomcat\jakarta-tomcat-3.2.3\work\localhost_8080\_0002flogin_0002flogin_0002ejsplogin_jsp_9.java:79: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement statement = Conn.createStatement();
^
Here are my codes:
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection Conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/Login?user=Administrator&password=");
Statement statement = Conn.createStatement();
it there anything wrong? pls help...
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
As you can see in the line:
Ambiguous class: java.beans.Statement and java.sql.Statement
you have 2 classes called Statement but in different packages to go around this change the line where you reference the Statement
Statement statement = Conn.createStatement();
to:
java.sql.Statement statement = Conn.createStatement();
this should stop this error.
regards.
Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
Thank you ver much!
but at the top of my page i have included:
<%@ page language="java" import="java.sql.*" %>
so why do i have to retype: java.sql.Statement statement = Conn.createStatement();
what is the reason?

Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
Thanks !!!
There's one question thought, i have included the :
<%@ page language="java" import="java.sql.* %><br /> at the top of my JSP page. So why do i have to retype for<br /> java.sql.Statement....
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
I think I miss something here what did you include at the top of your jsp page?
Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
page language="java" import="java.sql.*
 
wood burning stoves
 
subject: Help Me