Home » Developer & Programmer » JDeveloper, Java & XML » java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER (Oracle, 10g, Linux)
java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER [message #358813] Wed, 12 November 2008 10:05 Go to next message
bman147
Messages: 3
Registered: November 2008
Junior Member
Hi,

* If this is the wrong forum for this sorry. Please move to the appropriate forum.

I'm having issues trying to connect to my Oracle 10g DB via the jdbc driver. Here's my code:

import java.sql.DriverManager;
import java.sql.SQLException;
import oracle.jdbc.driver.OracleConnection;

public class StringSearcher {

	public static void main(String[] args) throws SQLException {
		
		DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
		OracleConnection conn = (OracleConnection)DriverManager.getConnection("jdbc:oracle:thin:@hostname:1521:orcl", "USERNAME", "PASSWORD");
		conn.close();
	}
	
}


and here's the error trace:

Exception in thread "main" java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
        at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:791)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
        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:801)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at StringSearcher.main(StringSearcher.java:11)


I'm using the ojdbc14.jar file for the Oracle classes. As you can see it's very simplistic but I still can't get it to connect.

* Note: The username I am using to connect with is not SYS so I'm not sure where that error is coming from.

Any help would be greatly appreciated. Google has got me nowhere Sad

Thanks,
Brendan
Re: java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER [message #358827 is a reply to message #358813] Wed, 12 November 2008 10:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
 *Cause:    connect SYS/<password> is no longer a valid syntax
 *Action:   Try connect SYS/<password> as SYSDBA or
            connect SYS/<password> as SYSOPER


Quote:
* Note: The username I am using to connect with is not SYS

Maybe but as we have not your actual code and what you actually did the only thing we can do is to trust Oracle.

Regards
Michel

[Updated on: Wed, 12 November 2008 10:22]

Report message to a moderator

Re: java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER [message #358837 is a reply to message #358827] Wed, 12 November 2008 11:01 Go to previous messageGo to next message
bman147
Messages: 3
Registered: November 2008
Junior Member
Okay. Here's the code in unmodified format:

import java.sql.DriverManager;
import java.sql.SQLException;
import oracle.jdbc.driver.OracleConnection;

public class StringSearcher {

	public static void main(String[] args) throws SQLException {
		
		DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
		OracleConnection conn = (OracleConnection)DriverManager.getConnection("jdbc:oracle:thin:tomsserver:1521:orcl", "TOM", "TOMSPASSWD");
		conn.close();
	}
	
}


Any ideas?
Re: java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER [message #359005 is a reply to message #358837] Thu, 13 November 2008 05:07 Go to previous messageGo to next message
bman147
Messages: 3
Registered: November 2008
Junior Member
Thanks for all the help I received here. I found it most helpful.
Re: java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER [message #359016 is a reply to message #359005] Thu, 13 November 2008 05:44 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
So what was the problem and what was the solution?

Regards
Michel
Previous Topic: XML_TYPE Problem
Next Topic: Java Stored Prcedures in Oracle
Goto Forum:
  


Current Time: Sun Nov 24 00:58:22 CST 2024