Connecting to the Oracle 10g Database through Java code

I have a Oracle 10g database to be connected to.

Through sql plus, I can connect to it using the following command

>sqlplus"sys@pmi as sysdba"

and password is 'password'

how do I connect to this db through my Java code?

I tried

_connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi as sysdba","sys","password");

but it gave the exception "ExceptionIo exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))"

I also tried

_connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi","sys","password");

but this gives the exception "ExceptionORA-28009: connection as SYS should be as SYSDBA or SYSOPER"

Can anyone please help me in writing the line of code

[1031 byte] By [arc_ga] at [2007-11-27 2:19:35]
# 1
You need to use the getConnection syntax that requires a Properties object. http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_05- cafal
cafala at 2007-7-12 2:20:16 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...