File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes Using Oracle package variables in JDBC. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Using Oracle package variables in JDBC." Watch "Using Oracle package variables in JDBC." New topic
Author

Using Oracle package variables in JDBC.

Kumar Shanmugam
Greenhorn

Joined: May 14, 2004
Posts: 29
Can anybody know how we can use Oracle Package variable in Java/JDBC?

I am using a insert trigger on a table which will initialize the login user
from a package variable.In my log4j configuration file, while inserting data into this table, I am updating the user with my current user. But the insert statement is not identifying the user and it is inserting null.

PLease let me know.


Kumar Shanmugam,<br />Atlanta, USA.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32319
    
213

Kumar,
A trigger is defined on the database, not through JDBC. So this gets the problem out of the Java sphere.

If you can post the trigger here, maybe someone will see a problem with it.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Kumar Shanmugam
Greenhorn

Joined: May 14, 2004
Posts: 29
Here is the trigger.

----------------------
create or replace TRIGGER DWUSER.TDS_JAVA_LOG_TRIG
BEFORE INSERT
ON DWADMIN.TDS_JAVA_LOG
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
tmpVar NUMBER;
BEGIN
tmpVar := 0;

:NEW.login_date := systimestamp;
:NEW.user_id := log_user.v_log_user;

END tds_java_log_trig;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Oracle package variables in JDBC.
 
It's not a secret anymore!