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
posted
0
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
posted
0
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
posted
0
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
posted
0
I think I miss something here what did you include at the top of your jsp page?