22

I was using a SQuirrel SQL Client to connect & browse my oracle database servers. I have given the credentials in the connection URL itself. But it still prompts for the username and password. Does it really required to provide additional username/password while establishing connection. Won't it take it from the connection URL?

jdbc:oracle:thin:username/password@my.oracle.server.domain.com:1521:DBName
Siva Arunachalam
  • 7,582
  • 15
  • 79
  • 132

4 Answers4

15

Thin driver Oracle's JDBC Thin driver uses Java sockets to connect directly to Oracle. It provides its own TCP/IP version of Oracle's SQL*Net protocol. Because it is 100% Java, this driver is platform independent and can also run from a Web Browser (applets). There are 2 URL syntax, old syntax which will only work with SID and the new one with Oracle service name.

Old syntax

jdbc:oracle:thin:@[HOST][:PORT]:SID

New syntax

jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE

On new syntax SERVICE may be a oracle service name or a SID.

There are also some drivers that support a URL syntax which allow to put Oracle user id and password in URL.

jdbc:oracle:thin:[USER/PASSWORD]@[HOST][:PORT]:SID

jdbc:oracle:thin:[USER/PASSWORD]@//[HOST][:PORT]/SERVICE

source: http://www.orafaq.com/wiki/JDBC

Community
  • 1
  • 1
cirovladimir
  • 593
  • 6
  • 25
9

Refer to this link, it will help you.

https://jdbc.postgresql.org/documentation/use/#connection-parameters

For example, if you want to include username & password in the Postgres connection string.

jdbc:postgresql://postgres-10.4.cluster:5432/default?user=postgres&password=postgres
davidlj95
  • 124
  • 7
3

Won't it take it from the connection URL?

I think No

You need to enter usrename & password.

Check: http://squirrel-sql.sourceforge.net/user-manual/quick_start.html#howtoconnect

section Connecting

Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96
  • Depends on the implementation. Drivers should be able to handle the connection string "jdbc:oracle:thin:@${HOST}:${PORT}:${SID}?user=${UID}&password=${PWD}" – access_granted Apr 17 '20 at 02:16
1

From what I have seen, support for passing the username/password in the JDBC URL is inconsistent across Oracle JDBC Drivers.

David O'Meara
  • 2,983
  • 25
  • 38