我正在尝试使用 Slick 连接到 Oracle。
我得到了slick-extensions_2.10-1.0.0.jar
.
在 Scala 中添加了以下行
Database.forURL("jdbc:oracle:thin:@myhost:myport:dbalias", "myid", "mypwd", null, driver =
"com.typesafe.slick.driver.oracle.OracleDriver") withSession {.......}
由于我收到以下错误,因此该驱动程序使用的正确 URL 是什么:
Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@myhost:myport:dbalias
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at scala.slick.session.Database$$anon$2.createConnection(Database.scala:105)
at scala.slick.session.BaseSession.conn$lzycompute(Session.scala:207)
at scala.slick.session.BaseSession.conn(Session.scala:207)
at scala.slick.session.BaseSession.close(Session.scala:221)
at scala.slick.session.Database.withSession(Database.scala:38)
at scala.slick.session.Database.withSession(Database.scala:46)