Search code examples
javaoracle-databasenetbeanstoadcreateuser

Oracle / Netbeans Login Issue


Oracle 11 XE / Netbeans 8.0.2 / Toad 12.7.1.11

Be forewarned: Noob on this stuff...

So I logged into Oracle via Toad as SYS and created a new user (Jason). Ended the connection, and connected under the new user. No sweat. Created a simple 2-column table and inserted 6 or 7 rows. Disconnected, reconnected (as Jason) and ensured my little table and data were still there. Great.

So I start a new project in Netbeans and try to connect to the db as Jason. JDBC won't connect, I get

"Cannot establish a connection to jdbc:oracle:thin@localhost:1521:XE using OracleDriver (OR-28009: c

And that's all I have to go on. The error message is truncated (as above) by the New Connection Wizard's window.

Wierd -- It won't let my connect as SYS, either.

Wierder -- I CAN connect as SYSTEM. That account succeeds.

So I'm obviously missing something, but what?


Solution

  • it looks that your project still using SYS connection...

    when you connect as SYS user you need add as SYSDBA or SYSOPER option the ORA-28009 error originally says

    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
    

    rather than use SYS user and the options I'd recommend you create new user and grant him DBA role and then connect as this user:

    connect sys/<password>@myserver as sysdba
    create user mydba identified by mydbapassword;
    grant dba to mydba;
    connect mydba/mydbapasswor@myserver
    ...do what you need