No suitable driver found for jdbc:orcale:thin:@127.0.0.1:1521:orcl

连接数据库的时候报了这个异常

Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error opening session.  Cause: java.sql.SQLException: No suitable driver found for jdbc:orcale:thin:@127.0.0.1:1521:orcl
### Cause: java.sql.SQLException: No suitable driver found for jdbc:orcale:thin:@127.0.0.1:1521:orcl
 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
 at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:83)
 at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:32)
 at com.dragon.test.Test.main(Test.java:31)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:orcale:thin:@127.0.0.1:1521:orcl
 at java.sql.DriverManager.getConnection(DriverManager.java:602)
 at java.sql.DriverManager.getConnection(DriverManager.java:185)
 at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:64)
 at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:349)
 at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:55)
 at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:73)
 ... 2 more

意思是没有找到这个驱动

搞了半天都还是这样子 最后想重新写一个jdbc 一看好了

错误原因:原来是自己的driver的字符串写错了

 jdbc:orcale:thin:@127.0.0.1:1521:orcl   这是之前的

 jdbc:oracle:thin:@127.0.0.1:1521:orcl 这是修改后的

好了!特此一记 希望没有人和我犯同样的错误
 

你可能感兴趣的:(java)