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

