当前位置:数据库 > Oracle >>

oracle 10g连接My Eclipse 8.5,jdk1.6.0_10,老是报错,求解,数据库大神进啊!!!

报错:No suitable driver found for jdbc:orcl:@localhost:8080:orcl 在My Eclipse 8.5中 已经添加classes12.jar数据库oracle 10g驱动。代码如下: //装载驱动程序 Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); //创建连接 String url="jdbc:orcl:@localhost:8080:orcl"; //student为你的数据库的 String user="system"; String password="tur"; // Connection conn= DriverManager.getConnection(url,user,password);
补充:报错内容
严重: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: No suitable driver found for jdbc:orcl:@localhost:8080:orcl
	at java.sql.DriverManager.getConnection(DriverManager.java:602)
	at java.sql.DriverManager.getConnection(DriverManager.java:185)
	at org.apache.jsp.insert_jsp._jspService(insert_jsp.java:74)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	。。。。。。
追问:OJDBC14.JAR也不行不行啊jdbc:oracle:thin:@localhost:1521:orcl  也不行确定没问题严重: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: No suitable driver found for jdbc:orcl:@localhost:8080:orcl后来搞好了
答案:你的oracle数据库的驱动包有问题,不是classes12.jar,而是OJDBC14.JAR。
其他:将驱动类添加到Java\jdk1.6.0_10\jre\lib\ext里面试一试!! classes12.jar是老版本的jdbc驱动,最好用ojdbc14.jar
你的连接串好像不对,一般是这样的:jdbc:oracle:thin:@localhost:1521:orcl 驱动包和连接驱动字符串有问题 

上一个:用oracle 11g连接别人的数据库 是否只需要在 Net Manager里面进行配置 不在listener.ora里面配置可以吗
下一个:ORACLE数据库查询语句

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,