DumbaDonf Caca de fête, caca qui fouette | Ok, maintenant j'ai installe JDK, Tomcat, mon serveur marche nickel. G lu pas ;al de tuto et de doc, j'ai fait des petits exo et tout. Mais maintenant j'aimerais me connecter ma BDD Oracle et je n'y arrive pas.
Voici mon code:
Citation :
<%@ page import="java.sql.*"%>
<html>
<head>
<title>bd</title>
</head>
<body>
<%
try{
Class.forName("oracle.jdbc.driver.OracleDriver" );
String url = "jdbc:oracle:thin:@NOMMACHINE:1521:NOMBASE";
Connection con = DriverManger.getConnection(url,"LOGIN","PASS" );
Statment s = con.createStatment();
String q = "select * from test";
ResultSet r = s.executeQuery(q);
while(r.next())
{ %>
<%=r.getString(col1)%>
<br>
<% }
}
catch (SQLException e) {
e.printStackTrace();
}
%>
</body>
</html>
|
erreur:
Citation :
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 7 in the jsp file: /bdd.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\bdd_jsp.java:53: cannot resolve symbol
symbol : variable DriverManger location: class org.apache.jsp.bdd_jsp
Connection con = DriverManger.getConnection(url,"LOGIN","PASS" );
^
An error occurred at line: 7 in the jsp file: /bdd.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\bdd_jsp.java:54: cannot resolve symbol
symbol : class Statment location: class org.apache.jsp.bdd_jsp
Statment s = con.createStatment();
^
An error occurred at line: 7 in the jsp file: /bdd.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\bdd_jsp.java:54: cannot resolve symbol
symbol : method createStatment ()
location: interface java.sql.Connection
Statment s = con.createStatment();
^
An error occurred at line: 17 in the jsp file: /bdd.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\bdd_jsp.java:61: cannot resolve symbol
symbol : variable col1 location: class org.apache.jsp.bdd_jsp
out.print(r.getString(col1));
^
4 errors
|
|