I get a SQLException, when trying to connect to oracle 10g xe in java(NetaBeans IDE 6.1) [message #386381] |
Sat, 14 February 2009 03:08 |
turkuaz07
Messages: 4 Registered: February 2009
|
Junior Member |
|
|
Hi everyone....
I imported the ojdbc14.jar into the library and tried to connect to the Oracle 10g.
Connection con;
String className="oracle.jdbc.driver.OracleDriver";
public void baglanti() {
try {
Class.forName(className);
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","hr","hr");
con.close();
System.out.println("bağlantı tamamdır koç..");
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: " + cE.toString());
}
--As you see my code,it works
but when ı changed line: "DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","sys","1");"
it doesnt work.
because my username is "sys" and my password is "1".
can anybody help me???
}
|
|
|
Re: I get a SQLException, when trying to connect to oracle 10g xe in java(NetaBeans IDE 6.1) [message #386382 is a reply to message #386381] |
Sat, 14 February 2009 03:23 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
"It doesn't work" is NOT an Oracle message.
Hello doc, I'm sick, can you help me? Are you sure this is enough for doc to help you?
I bet your message was (if you really gave the correct password):
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
And the answer is:
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
Regards
Michel
[Updated on: Sat, 14 February 2009 03:24] Report message to a moderator
|
|
|
|
|