How to test an jdbc connection in sqlplus?

Hi experts:

A programmer told me to test this in sqlplus and I don't know how to test it:

jdbc:oracle:thin:@192.168.112.223:1521:SCSD1.

And this one:  "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.112.223)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.112.224)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SCSD_RAC)))"


Scsd1 is one of the instance from a two node Oracle Rac version 10.2.0.3
Scsd_rac is the service name of the ORacle Rac version 10.2.0.3

My tnsnames.ora is working and have the following entries for Scsd1 and scsd_rac:

SCSD1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.112.223)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = SCSD1)
    )
  )

SCSD_RAC =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hpscs1-vip1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hpscs2-vip1)(PORT = 1521))
      (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SCSD_RAC)
      (FAILOVER_MODE =
        (TYPE = SELECT)
        (METHOD = BASIC)
        (RETRIES = 180)
        (DELAY = 5)
      )
    )
  )
LVL 8
LindaCAsked:
Who is Participating?
 
JPrzybyszewskiCommented:
I would say that it's enough if you just establish a connection to the database using SQLPLUS using SCSD_RAC service name.
Alternatively you can try to connect as following:

sqlplus user/password@"(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.112.223)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.112.224)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SCSD_RAC)))"

This should also work.

Cheers,
Jarek
0
 
sdstuberCommented:
you can't test the jdbc with sqlplus itself.  You could create a java stored procedure that does a jdbc connection and then invoke that with sqlplus
0
 
LindaCAuthor Commented:
Thank you Jarek and sdstuber.

Jarek's connection worked.  So I will tell the Programmer to test this.
 
0
 
LindaCAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.