N
N
nurzhannogerbek2018-11-11 15:00:53
Java
nurzhannogerbek, 2018-11-11 15:00:53

How to properly connect Play Framework with Oracle 12?

Hello comrades! I am trying to connect to a remote Oracle 12
database in a Play Framework project. I am using Scala 2.12 and Play Framework 2.6.20 . From the official Oracle page, I downloaded the ojdbc8.jar file . Next, I placed it in the lib directory . In the build.sbt file I put the following:

credentials += Credentials("oracle", "login.oracle.com", "@email", "@password")
resolvers += "oracle" at "maven.oracle.com"
libraryDependencies ++= Seq("com.oracle.jdbc" % "ojdbc8" % "12.2.0.1")

Unfortunately, when I try to build the project in the console, I see the following error:
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: com.oracle.jdbc#ojdbc8;12.2.0.1: oracle: unable to get resource for com/oracle/jdbc#ojdbc8;12.2.0.1: res=maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom: java.net.MalformedURLException: no protocol: maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn] 	Note: Unresolved dependencies path:
[warn] 		com.oracle.jdbc:ojdbc8:12.2.0.1 (C:\Users\NNogerbek\IdeaProjects\saturn\build.sbt#L25-26)
[warn] 		  +- saturn:saturn_2.12:1.0
[error] (*:update) sbt.ResolveException: unresolved dependency: com.oracle.jdbc#ojdbc8;12.2.0.1: oracle: unable to get resource for com/oracle/jdbc#ojdbc8;12.2.0.1: res=maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom: java.net.MalformedURLException: no protocol: maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom

Please tell me what I am doing wrong and how to fix the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2018-11-13
@alfss

And why did you download if you specify what should be dragged from the repository?
Correct is this:

resolvers += "oracle" at "https://maven.oracle.com"
credentials += Credentials("oracle download", "maven.oracle.com", "[email protected]", "password")

libraryDependencies ++= Seq(
  "com.oracle.jdbc" % "ojdbc8" % "12.2.0.1"
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question