JSP链接数据库出现No suitable driver found for jdbc错误
错误:Nosuitabledriverfoundforjdbc:oracle:thin:@10.87.225.240:1521:prbt代码<%try{Stringurl...
错误:No suitable driver found for jdbc:oracle:thin:@10.87.225.240:1521:prbt
代码
<%
try{
String url="jdbc:oracle:thin:@10.87.225.240:1521:prbt";
Connection conn=DriverManager.getConnection(url,"jl","db_123");
Class.forName("oracle.jdbc.driver.OracleDriver");
/*stmt=conn.prepareStatement("select MACHINE_DESC from NETMGR_MACHINE_DEF where CRBT_SYS_ID=10");*/
PreparedStatement stmt=conn.prepareStatement("select LINK_NAME from CRBT_LINK_DEF");
ResultSet rs1=stmt.executeQuery();
while(rs1.next()){
out.println("<A>"+rs1.getString(1)+"</A>");
}
rs1.close();
stmt.close();
conn.close();
}
catch(Exception e){
System.out.println(e.getMessage());
}%> 展开
代码
<%
try{
String url="jdbc:oracle:thin:@10.87.225.240:1521:prbt";
Connection conn=DriverManager.getConnection(url,"jl","db_123");
Class.forName("oracle.jdbc.driver.OracleDriver");
/*stmt=conn.prepareStatement("select MACHINE_DESC from NETMGR_MACHINE_DEF where CRBT_SYS_ID=10");*/
PreparedStatement stmt=conn.prepareStatement("select LINK_NAME from CRBT_LINK_DEF");
ResultSet rs1=stmt.executeQuery();
while(rs1.next()){
out.println("<A>"+rs1.getString(1)+"</A>");
}
rs1.close();
stmt.close();
conn.close();
}
catch(Exception e){
System.out.println(e.getMessage());
}%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询