I receive this error:
java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
How to fix? (I need to be SY
/*It works for me*/
/*also oci and thin is important if you want to connect with database which is installed in your clien (Computer) add oci if you want to install to server add thin*/
String dbURL2 = "jdbc:oracle:oci:@172.16.24.123:1521:XE";
String username = "sys as sysdba";
String password = "XX Change it to your system password";
try {
Connection connection = DriverManager.getConnection(dbURL2, username, password);
System.out.println("Connected to Oracle data");
} catch (SQLException e) {
System.out.println("Opps ! error");
e.printStackTrace();
}
You need to put sysdba with user String parameter like
String user="sys as sysdba"