Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Specify SYSDBA Role for SYS Login

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my JDBC driver connect as SYS user, how can I specify the SYSDBA role? I encountered this exception when connecting from a DataSource:
Exception in thread "main" java.sql.SQLException: ORA-28009: connection to sys should be as sysdba or sysoper

I know that if I get connection from DriverManager, I can pass a property object with the internal_logonproperty set to sysdba. But similar option doesnt seem to exist for OracleDataSource. How could I do it if I want to go thru the datasource?
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alec,
If you are using Oracle 10g, then (and this is only a suggestion) perhaps "connection attributes" will help you. Here is a relevant article:

http://www.oracle.com/technology/oramag/oracle/04-jul/o44dev_jdbc.html

Good Luck,
Avi.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!