syntax error on token "class"
这是源代码,为什么class有错?
<%@ page contenttype="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%@ page import java.sql.Connection%>
<%@ page import java.sql.DriverManager%>
<html>
<body>
<%class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@localhost:1521:orcl";
//orcl为你的数据库的sid
String user="gege";
String password="gege";
Connection conn= Drivermanager.getconnection(url,user,password);
Statement stmt=conn.createstatement();
String sql="select * from users";
Resultset rs=stmt.executequery(sql);
while(rs.next()) {%>
您的第一个字段内容为:<%=rs.getstring(1)%>
您的第二个字段内容为:<%=rs.getstring(2)%>
<%}%>
<%out.print("数据库操作成功,恭喜你");%>
<%rs.close();
stmt.close();
conn.close();
%>
</body>
</html>