Skip to Main Content
  • Questions
  • Extract logon credentials from JDBC connection and pass them to SQL*Loader

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Aziz.

Asked: July 02, 2012 - 5:43 am UTC

Last updated: July 03, 2012 - 10:52 am UTC

Version: 10.0.2

Viewed 1000+ times

You Asked

Hi,
I want to use an Oracle JAVA class in order to call SQL*Loader from PL/SQL.
I my class, i instantiate a connection object with this Oracle JAVA special JDBC url:
Connection conn = DriverManager.getConnection("jdbc:default:connection");

I would know if there's a way to extract logon credentials from conn and use them to construct a SQL*Loader calling string :
sqlldr.exe USERID=<username>/<password>@<dbname>...

and Tom said...

You do not want to do this,

you want to use an external table - with an external table you can read files using SQL.

MUCH better than the old fashioned, 20th century tool that was cool in its time but is now very much outdated called sqlldr.


http://docs.oracle.com/cd/B19306_01/server.102/b14220/schema.htm#i36180

and since you would just be using sql - a simple select - you probably don't need any of this java stuff.


you cannot get the password - that would be a huge security issue if code in a session could just retrieve the password from somewhere.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

I rate

Aziz, July 11, 2012 - 4:31 am UTC

Thanks for the tip.
I think it's time to evolve to the 21st century.

More to Explore

Security

All of the vital components for a secure database are covered in the Security guide.