[1.3.1] Oracle JDBC connection

596 views
Skip to first unread message

Mumuney Abdlquadri

unread,
Sep 28, 2015, 1:19:47 PM9/28/15
to play-fr...@googlegroups.com
Hi all,

I am using play 1.3.1 trying to connect to an oracle 12c db with these config;

db.default.url="jdbc:oracle:thin:@//remote_host_url:port/orcl"
db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.user=user
db.default.password=pwd

I also include ojdbc14.jar in my lib folder.

But I am getting this error upon start:

Please what can I do to resolve this.

Thanks.


Internal Server Error (500) for request GET /login

Database error
A database error occured : Cannot connected to the database[default],
invalid arguments in call

play.exceptions.DatabaseException: Cannot connected to the
database[default], invalid arguments in call
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:200)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:515)
at play.Play.start(Play.java:537)
at play.Play.detectChanges(Play.java:641)
at play.Invoker$Invocation.init(Invoker.java:199)
at Invocation.HTTP Request(Play!)
Caused by: java.sql.SQLException: invalid arguments in call
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:132)
... 5 more





Please what can I do to resolve this.

Thanks.

Þór Sigurðsson

unread,
Sep 29, 2015, 4:04:59 AM9/29/15
to play-fr...@googlegroups.com
Try db.default.url="jdbc:oracle:thin:@remote_host:port:orcl"

Where remote_host is your database host, port is normally 1521 and orcl is the name of your schema.

The // should be superfluous (unless the URLs have changed between 2.3 and 2.4, which I doubt)
>--
>You received this message because you are subscribed to the Google Groups "play-framework" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAGDHiznTVuyQ_vWBMpeEiJ%2BDmtZ8pm9sdwajEhjhE6%2BTqmANLA%40mail.gmail.com.
>For more options, visit https://groups.google.com/d/optout.

________________________________

Fyrirvari á tölvupósti / e-mail disclaimer
http://www.samgongustofa.is/fyrirvari/
'

Mumuney Abdlquadri

unread,
Sep 29, 2015, 4:23:00 AM9/29/15
to play-fr...@googlegroups.com
Thanks Þór Sigurðsson,

I have tried your suggestion but I still have the same error.

I am connecting from my local computer to a remote server I hope this
not a problem. There are no firewalls.

Any other suggestion will be appreciated.

Anyone who has successfully connected to an Oracle DB might want to
share their conf.

Regards
> To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/27F3E3CD-873C-4F53-9018-0397F29E456C%40samgongustofa.is.

Þór Sigurðsson

unread,
Sep 29, 2015, 4:52:42 AM9/29/15
to play-fr...@googlegroups.com
My "suggestion" was taken from my live configuration where I connect to five distinct Oracle databases.

My full configuration for a single db (obviously changed so not to reveal sensitive information):

db.xydbdev.driver=oracle.jdbc.driver.OracleDriver
db.xydbdev.url="jdbc:oracle:thin:@server.domain.tld:1521:xydbdev"
db.xydbdev.user="USER"
db.xydbdev.password="PASS"
db.xydbdev.jndiName=XYDB_DEV




If that's not working for you, you might want to try the connectivity using a third party program first ( like DBVisualiser or some of the Oracle tools ) and verify that you can in deed connect to the database - and that you are allowed to connect to the schema.
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAGDHizkQWrnzOkyz7AXHiqBnUoRhsK9iPDnMurAKOWy%2BN8-vPQ%40mail.gmail.com.

Mumuney Abdlquadri

unread,
Sep 29, 2015, 5:16:08 AM9/29/15
to play-fr...@googlegroups.com
Thanks again. I have used same parameters to connect to the server
using Netbeans (on the Services Tab). I am really baffled.

Please may I ask, which odbc.jar you use. I have tried odbc14.jar,
odbc7.jar, odbc6.jar.

I am now getting this error:

Cannot connected to the database[default], ORA-01005: null password
given; logon denied

Eventhough the password is there.

Regards.
> To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/9FA99994-33F0-4571-8CC6-04EA1579E94B%40samgongustofa.is.

Grzegorz Slowikowski

unread,
Sep 29, 2015, 5:17:43 AM9/29/15
to play-framework
Hi

Upgrade Oracle JDBC driver to "ojdbc5" or newer. "ojdbc14" does not work properly with Oracle 12c.

Regards
Grzegorz Slowikowski

Þór Sigurðsson

unread,
Sep 29, 2015, 10:59:03 AM9/29/15
to play-fr...@googlegroups.com
Currently using ojdbc14.jar
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAGDHizmdiyDRz2BKsv8UTSKSji_q5VxpVekjN8oRC89qg8DV3Q%40mail.gmail.com.

Þór Sigurðsson

unread,
Sep 29, 2015, 11:00:47 AM9/29/15
to play-fr...@googlegroups.com
Ah... Grzegorz Slowikowski may have something there - I'm connecting to Oracle 11 and didn't notice your 12c requirement.

If Oracle updated their connector the updated one should of course be used...
>To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAGDHizmdiyDRz2BKsv8UTSKSji_q5VxpVekjN8oRC89qg8DV3Q%40mail.gmail.com.

Mumuney Abdlquadri

unread,
Sep 29, 2015, 12:53:57 PM9/29/15
to play-fr...@googlegroups.com
Thanks Grzegorz,

I can confirm "ojdbc14" does not work with 12c. "ojdbc6" and "ojdbc7" do work.

But it is reporting that the password is null even though I have added
it to the conf.

"Cannot connected to the database[default], ORA-01005: null password
given; logon denied"

If I try multiple times that account gets locked.
> To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/DDB3E683-9D44-4C8C-8869-B159A33C84AC%40samgongustofa.is.

Grzegorz Słowikowski

unread,
Sep 30, 2015, 4:58:37 AM9/30/15
to play-fr...@googlegroups.com
Hi

Change:
db.default.password=pwd
to
db.default.pass=pwd

:)

Grzegorz

Mumuney Abdlquadri

unread,
Sep 30, 2015, 8:10:17 AM9/30/15
to play-fr...@googlegroups.com
Yeah Thanks.

Just realized also this morning. I have been offline so I could not
update this thread.

Thanks everyone.

Regards.
> To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/560BA433.3050007%40gmail.com.
Reply all
Reply to author
Forward
0 new messages