Using Oracle package variables in JDBC.
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.
Siva,
You said:
It is not inserting the user in the tableI see no table, here. Only a variable in a PL/SQL package.
You also said:
But the same is working in Oracle.Do you mean in SQL*Plus?
Siva, try to forget how you are doing it, and tell me what you are trying to do.
Do you have some UPDATE_USER column in your database tables where you record the username of the person who did the operation?
Are you trying to write a trigger that populates this column?
If so, then all you need is something like:
create or replace trigger MY_TRIG
after insert or update
on MY_TABLE
for each row
begin
:new.UPDATE_USER := user;
end;Good Luck,
Avi.
P.S. By the way, what has this to do with OC4J?
Similar Messages
-
Using Oracle Packages in Oracle BI EE
I am trying to replicate old Discoverer reports in Oracle BI EE. In the old Discoverer reports, they would include the package and function information in the SELECT statement of the SQL. When I try to import the database information in BI EE, I can only get table and view information, not the packages. How do you access and use Oracle packages in BI EE? Thanks in advance for any help you may be able to provide.
If you have OBIEE 10.1.3.3 OBIEE you can use BI built-in EVALUATE function to call user-defined functions in database.
This function is intended for scalar and analytic calculations.
Syntax: EVALUATE('DB_Function(%1)', <Comma separated Expression>)
Example: SELECT e.lastname,sales.revenue,EVALUATE('dense_rank() over(order by %1 )',sales.revenue) FROM sales s, employee e; -
How to use oracle collection type with JDBC?
I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
Java Version : Java 1.4
JDBC Driver : Oracle Oci Driver
DB: Oracle 9i
No 1. Package
===========================================
create or replace package JDBC_ERP_IF_TEST AS
type NUM_ARRAY is table of number;
procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
procedure TEST(ABC IN NUMBER);
END JDBC_ERP_IF_TEST;
==================================================
No 2. Package Body
===============================================
CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
ERR_NO OUT NUMBER,
ERR_TEXT OUT VARCHAR2) is
begin
ERR_NO := 0;
ERR_TEXT := '';
dbms_output.enable;
for i in 1 .. p_num_array.count() loop
dbms_output.put_line(p_num_array(i));
insert into emp (empno) values (p_num_array(i));
commit;
end loop;
EXCEPTION
WHEN OTHERS THEN
ERR_NO := SQLCODE;
ERR_TEXT := ERR_TEXT ||
' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
ROLLBACK;
RETURN;
end JDBC_ERP_IF_ARRAY_TEST;
procedure TEST(ABC IN NUMBER) IS
begin
insert into emp(empno) values (ABC);
commit;
end TEST;
end JDBC_ERP_IF_TEST;
===============================================
NO 3. Java Program
===============================================
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
cstmt.setArray(1, array);
cstmt.registerOutParameter(2, Types.INTEGER);
cstmt.registerOutParameter(3, Types.VARCHAR);
====================================================
couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
what can i do for this package and program? please help me..Something like this:
create or replace type t_record as object (
id number,
no number
CREATE or replace type t_table AS TABLE OF t_record;
set serveroutput on
declare
v_table t_table := t_table();
v_t1 t_table := t_table();
begin
v_table.extend(1);
v_table(1).ID := 1;
v_table(1).No := 10;
v_table.extend(1);
v_table(2).ID := 2;
v_table(2).ID := 20;
SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
from TableA
FROM TABLEA
WHERE ID IN (select t.ID from table(v_Table) t);
for i in 1..v_t1.count loop
dbms_output.put_line(v_t1(i).ID);
dbms_output.put_line(v_t1(i).No);
end loop;
end;
/Untested!
P;
Edited by: bluefrog on Mar 5, 2010 5:08 PM -
Hi all,
I have a package in my oracle 10g release 2 database. I have a function within the package. My question is, how do I retrieve the return value of the function. I am new to VB.NET having moved from Oracle Forms to VB.NET
Thanks in advance
MichaelSorry Guys I did not include the code in this thread.
This is the function I am trying to run.
CREATE OR REPLACE PACKAGE BODY Weblogica_Systems
FUNCTION User_Exist(varUSERNAME IN VARCHAR2, varPASSWORD IN VARCHAR2)
RETURN INTEGER
AS
myUSERNAME VARCHAR2(8);
myPASSWORD VARCHAR2(6);
myString1 VARCHAR2(40) := 'This User does not exist';
User_Flag NUMBER;
BEGIN
SELECT USERNAME, PASSWORD
INTO myUSERNAME, myPASSWORD
FROM USERS
WHERE USERNAME = varUSERNAME
AND PASSWORD = varPASSWORD;
IF varUSERNAME != myUSERNAME AND varPASSWORD != myPASSWORD THEN
User_Flag := 2;
ELSE
User_Flag := 1;
END IF;
RETURN User_Flag;
EXCEPTION WHEN NO_DATA_FOUND THEN
dbms_output.put_line('User Does Not Exist');
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20001, 'An error was encountered - '||SQLCODE||' - ERROR - '||SQLERRM);
END User_Exist;
This is the VB.NET code I am using in calling the function
Dim oraConnect As New OracleConnection("Data Source=DEVELOPM; User id=VS_DEVELOPER; Password=f00tball;")
Dim myCMD As New OracleCommand("Weblogica_Systems" & ".User_Exist", oraConnect)
Dim Val As Integer
Try
Admin.stbMain.Text = "Connecting...."
oraConnect.Open()
Admin.stbMain.Text = "Ready"
myCMD.Connection = oraConnect
myCMD.CommandType = CommandType.StoredProcedure
myCMD.CommandText = "weblogica_systems.User_exist"
myCMD.Parameters.Add(New OracleParameter("varUSERNAME", OracleDbType.Varchar2, 2000, ParameterDirection.Input)).Value = "MUMOETUK" 'txtUsername.Text
myCMD.Parameters.Add(New OracleParameter("varPASSWORD", OracleDbType.Varchar2, 2000, ParameterDirection.Input)).Value = "TESTME" 'txtPassword.Text
myCMD.Parameters.Add(New OracleParameter("RetVal", OracleDbType.Int32, 20, ParameterDirection.ReturnValue))
myCMD.ExecuteNonQuery()
Val = myCMD.Parameters("RetVal").Value
Catch oraErr As OracleException
MessageBox.Show(oraErr.Message)
Catch ExceptionErr As Exception
MessageBox.Show(ExceptionErr.Message, "Weblogica Data Systems [Login Error] ")
End Try
I am getting an error when I run this code. ORA-06503: PL/SQL Function return without value. I know the function is returning a value because I have tested in PL/SQL and it worked. Can anybody please help. -
XML Publisher/Bi Publisher Using Oracle Package and MS Word Template builde
My Question is I want to know more about grouping of elements while creating reports in E business suite.
my approach should be 1. pl sql package with embedded XML data to create xml output. 2. Formatting the xml output using ms word template builder plugin.
My question is if grouping is required, then where should it be? While creating package to generate xml output or while formatting xml o/p in ms word?
I wanted to create a check cancellation report where the report should look like below.
Bank Name American express
Bank address 1 Cape town city Road
bank address 2 Lane 2
Bank City Cape town
Branch Docara v'dola
Check number Amount Vendor Status
1023423 225 huawei Voided
1023430 500 Ericson Voided
Signature
Now for above grouping I Written some thing like below package:
But I want to know Had I not done the grouping in Package, would it have still be possible to do the grouping in MS Word template builder?
To simply fy question: If I had not written 2 cursors and written 1 simple cursor and had got simple 1 after 1 fields without any specific grouping in ora package, would it have been possible to do the same grouping while formatting the xml output in MS word template builder?
the part of code enclosed.
begin
DBMS_APPLICATION_INFO.SET_CLIENT_INFO(FND_PROFILE.VALUE('ORG_ID'));
--fnd_file.put_line (fnd_file.output, '<?xml version = "1.0" encoding="ISO-8859-1"?>');
fnd_file.put_line(fnd_file.output, '<G_HEAD>');
for rec1 in c_bank_main
loop
fnd_file.put_line(fnd_file.output, '<G_BANK>');
fnd_file.put_line (fnd_file.output,'<c_bank><![CDATA['|| rec1.c_bank ||']]></c_bank>');
fnd_file.put_line (fnd_file.output,'<c_bank_acc><![CDATA['|| rec1.c_bank_acc ||']]></c_bank_acc>');
fnd_file.put_line (fnd_file.output,'<c_bankadress1><![CDATA['|| rec1.c_bankadress1 ||']]></c_bankadress1>');
fnd_file.put_line (fnd_file.output,'<c_bankadress2><![CDATA['|| rec1.c_bankadress2 ||']]></c_bankadress2>');
fnd_file.put_line (fnd_file.output,'<c_bankadress3><![CDATA['|| rec1.c_bankadress3 ||']]></c_bankadress3>');
fnd_file.put_line (fnd_file.output,'<c_bankcity><![CDATA['|| rec1.c_bankcity ||']]></c_bankcity>');
fnd_file.put_line (fnd_file.output,'<c_branch><![CDATA['|| rec1.c_branch ||']]></c_branch>');
for rec in c_bank_child(rec1.c_bank)
loop
fnd_file.put_line(fnd_file.output, '<G_CHECK>');
fnd_file.put_line (fnd_file.output,'<c_currency_code><![CDATA['|| rec.c_currency_code ||']]></c_currency_code>');
fnd_file.put_line (fnd_file.output,'<c_pay_currency_code><![CDATA['|| rec.c_pay_currency_code ||']]></c_pay_currency_code>');
fnd_file.put_line (fnd_file.output,'<c_cleared_amount><![CDATA['|| rec.c_cleared_amount ||']]></c_cleared_amount>');
fnd_file.put_line (fnd_file.output,'<c_nls_status><![CDATA['|| rec.c_nls_status ||']]></c_nls_status>');
fnd_file.put_line (fnd_file.output,'<c_nls_status><![CDATA['|| rec.c_nls_status||']]></c_nls_status>');
fnd_file.put_line (fnd_file.output,'<c_check_stock_name><![CDATA['|| rec.c_check_stock_name ||']]></c_check_stock_name>');
fnd_file.put_line (fnd_file.output,'<status_lookup_code><![CDATA['|| rec.status_lookup_code ||']]></status_lookup_code>');
fnd_file.put_line (fnd_file.output,'<c_check_number><![CDATA['|| rec.c_check_number ||']]></c_check_number>');
fnd_file.put_line (fnd_file.output,'<c_sum_amount><![CDATA['|| rec.c_sum_amount ||']]></c_sum_amount>');
fnd_file.put_line (fnd_file.output,'<c_vendor_name><![CDATA['|| rec.c_vendor_name ||']]></c_vendor_name>');
fnd_file.put_line (fnd_file.output,'<c_doc_sequence_value><![CDATA['|| rec.c_doc_sequence_value ||']]></c_doc_sequence_value>');
fnd_file.put_line(fnd_file.output, '</G_CHECK>');
end loop;
fnd_file.put_line(fnd_file.output, '</G_BANK>');
end loop;
fnd_file.put_line(fnd_file.output, '</G_HEAD>');
endHi,
You can do grouping in either place. But ideally to avoid re-grouping in the BI Publisher Template your XML would be generated such that it is appropriate for your template.
This is really important when it comes to very large datasets as you should avoid regrouping in the template in this case.
Regards,
Gareth
http://garethroberts.blogspot.com
http://www.virtuate.com -
Cannot connect using oracle jdbc oci8 driver
I am using Oracle 8.1.5 JDBC oci8 driver, but when try to connect, always got ERROR: java.lang.UnsatisfiedLinkError:make_c_state
With the same code, but change to connect with thin driver, it works fine. Pls tell me the problem. Thank you.Hi,
Here is the snippet code from oracle,
// You need to import the java.sql package to use JDBC
import java.sql.*;
// We import java.io to be able to read from the command line
import java.io.*;
class JdbcCheckup
public static void main (String args [])
throws SQLException, IOException
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// Prompt the user for connect information
System.out.println ("Please enter information to test connection to the database");
String user;
String password;
String database;
user = readEntry ("user: ");
int slash_index = user.indexOf ('/');
if (slash_index != -1)
password = user.substring (slash_index + 1);
user = user.substring (0, slash_index);
else
password = readEntry ("password: ");
database = readEntry ("database (a TNSNAME entry): ");
System.out.print ("Connecting to the database...");
System.out.flush ();
System.out.println ("Connecting...");
Connection conn =
DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,
user, password);
System.out.println ("connected.");
// Create a statement
Statement stmt = conn.createStatement ();
// Do the SQL "Hello World" thing
ResultSet rset = stmt.executeQuery ("select 'Hello World' from dual");
while (rset.next ())
System.out.println (rset.getString (1));
System.out.println ("Your JDBC installation is correct.");
// close the resultSet
rset.close();
// Close the statement
stmt.close();
// Close the connection
conn.close();
// Utility function to read a line from standard input
static String readEntry (String prompt)
try
StringBuffer buffer = new StringBuffer ();
System.out.print (prompt);
System.out.flush ();
int c = System.in.read ();
while (c != '\n' && c != -1)
buffer.append ((char)c);
c = System.in.read ();
return buffer.toString ().trim ();
catch (IOException e)
return "";
This code can be run without specifying a TNSNAME connection string, as the oci8 jdbc driver will take localhost as default.
OR
Only specifying the TNSNAME is enough, i.e. edit %ORACLE_HOME%\network\ADMIN\TNSNAMES.ORA file and locate the XXXXX.WORLD entry in the file. This is the TNSNAME entry referred to.
Without TNSNAME entry you can re-run,
%ORACLE_HOME%\jdbc\demo\samples\oci8\basic-samples> java JdbcCheckup
Please enter information to test connection to the database
user: system
password: manager
database (a TNSNAME entry):
Connecting to the database...Connecting...
connected.
Hello World
Your JDBC installation is correct.
Hope that helps.
Best Luck!
Senthil Babu J -
PLS-00201: Not able to execute Oracle Package through Java app
Hi,
My struts application is trying to execute an oracle procedure (in a package) and is getting following error.
I have granted execute priveledge to the user using "Grant execute on <package name> to <user>"
Also, I am able to execute the procedure through this user in sqlplus.
I am using Oracle thin driver for JDBC.
Please guide.
+06:36:17,500 ERROR [STDERR] java.sql.SQLException: ORA-06550: line 1, column 7:+
PLS-00201: identifier 'uhbvn_public.GENSYSLOGIN' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)+
+06:36:17,500 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)+
+06:36:17,500 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:209)+
+06:36:17,500 ERROR [STDERR] at wenrgise.ejb.common.utility.DBUtilitiesBean.callProc(DBUtilitiesBean.java:390)+
+06:36:17,500 ERROR [STDERR] at wenrgise.sysadmin.ejb.business.SysLoginBO.getSysLoginUserInfo(SysLoginBO.java:57)+
+06:36:17,500 ERROR [STDERR] at wenrgise.sysadmin.ejb.facade.SysLoginFacadeBean.getLoginInfo(SysLoginFacadeBean.java:37)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+
+06:36:17,500 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:592)+
+06:36:17,500 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)+
+06:36:17,500 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)+
+06:36:17,500 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:960)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)+
+06:36:17,500 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+
+06:36:17,500 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:592)+
+06:36:17,500 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)+
+06:36:17,500 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)+
+06:36:17,500 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)+
+06:36:17,500 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)+
+06:36:17,500 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)+
+06:36:17,500 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)+
+06:36:17,500 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)+
+06:36:17,500 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)+
+06:36:17,500 ERROR [STDER+What part of
identifier 'uhbvn_public.GENSYSLOGIN' must be declareddon't you understand? -
Situation:
SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
Windows 7 - 64 bit.
The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
It uses 3 package variables:
*) SQLCommand (String) to specify the SQL Statement to be executed by the package
Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
Value: f:\Output Data.xls
*) EXCELOutputFIle (String) to specify path and filename of the Excel output file
Property path: \Package.Variables[User::SQLCommand].Properties[Value]
Value: select * from CartOrder
*) VarObjectDataSet (Object) to hold the data returned by SQL Server)
Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
Value: System.Object
It consists out of 2 components:
*) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
*) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only. This makes me wonder if it is uberhaupt possible to set the value of a package variable
of type Object.
Can anybody help me on this please ?
Message
Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 11.0.2100.60 for 32-bit Copyright (C) Microsoft Corporation. All rights reserved. Started: 6:40:20 PM DTExec: Could
not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object. Started: 6:40:20 PM Finished: 6:40:21 PM Elapsed: 0.281 seconds. The package execution failed. The step failed.
Thank you very much in advance
JurgenHi Visakh,
thank you for your reply.
So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
first question about the object type package variable.
Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
Thx in advance
Jurgen
Yes exactly
You need to set values only forthem which needs to be controlled from outside the package
Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Can anyone tell me how to access package variables from forms6. When I tried to access, it says 'Implementation Restriction : '|variable name|' : Cannot directly access remote package variable '. Is there any other way to access these variables.
Thanks in advance,
ParthaAnton,
Thanks for your reply. And this is a very good idea. since I have so many variables to store in the package, I think I need to pass variable name also to the function. I am exploring this feature mainly to replace global variables in forms. could you tell me how best is this idea of replacing global variables in forms with package variables ? and also if you have any sample code using these package variables in forms, could you please send me that.
Thanks
Partha
null -
Workaround for using Oracle JDBC extension with WLS pooling
Reading the newsgroup I saw that many of us encountered the problems
with ClassCastException when tried to use Oracle JDBC extension
with WLS pooling. I also had.
In this case BEA recommends to use dangerous
method getVendorConnection() which exposes
the physical connection object to your code.
Yes it's really dangerous because of unsafe usage may breaks
WLS pooled connection(s).
Moreover, this practice will make your JDBC code
unportable (your JDBC code in addition to Oracle dependence
became Weblogic dependent):
void doSmth() {
Connection con = ...;
Connection vCon = ((WLConnection)con).getVendorConnection();
// + mess of usage con in one places and vCon in others
// (where Oracle extensions are needed)
// !Don't forget to don't close vCon!
Sux.
I found the workaround.
Introduction
============
Yes the real cause of ClassCastException is that
in depth of Oracle driver the casting
to class oracle.jdbc.driver.OracleConnection
(not to interface oracle.jdbc.OracleConnection)
is performed.
Someone can say that this is bug or pure desing.
Weblogic pooled connection provide dynamic
implementation for all public interfaces
which real physical (wrapped) connection object implements.
Great feature!
But I guess that all interface methods implemented
by simple call-delegation to physical (wrapped) connection object.
In case of oracle.jdbc.OracleConnection interface
this approach doesn't work for at least one its method:
public OracleConnection unwrap()
WLS pooled connection shoudn't implement this method by
delegation to physical connection object BUT should
return physical connection object itself!
// Wrong implementation of unwrap()
// delegation is used
public OracleConnection unwrap() {
return physicalConnection.unwrap();
// Right implementation of unwrap()
// physical connection returned
public OracleConnection unwrap() {
return physicalConnection;
Workaround
==========
1. Develop your own OracleConnection wrapper class:
import oracle.jdbc.OracleConnection;
import weblogic.jdbc.extensions.WLConnection;
public class MyOracleConnectionImpl implements OracleConnection {
private OracleConnection con;
public MyOracleConnectionImpl(OracleConnection connection)
throws SQLException
this.con = connection;
public OracleConnection unwrap() {
return (OracleConnection)
((WLConnection)con).getVendorConnection();
/* Implement all other methods by delegation to con object */
2. Don't get Connections directly from DataSource --
develop your own simple (may be static) utility
class which retrives Connections from dataSource
and returns them wrapped into your MyOracleConnectionImpl
to your code from some method:
puclic abstract class MyConnectionSource {
public static Connection getConnection() {
Connection con = // get it from DataSource
return new MyOracleConnectionImpl((OracleConnection)con);
3. Add attribute RemoveInfectedConnectionsEnabled="false"
to definition of your JDBCConnectionPool within config.xml
You may do it because of you `safely` use vendorConnection --
you don't expose it to application code.
4. Enjoy the Oracle JDBC extensions in your code!
Example:
Connection con = MyConnectionSource.getConnection;
ArrayDescriptor add =
ArrayDescriptor.createDescriptor("your_type", con);
Hope it helps to someone.
Best regards,
Eugene VoytitskyHello Eugene Voytitsky,
Thanks Eugene Voytitsky for your idea
I have tried the solution suggested by You, but it did not work.
It still throws ClassCastException.
I am sorry for posting the whole code of two classes below.
I did this to give you more clarity.
I am also indicating the place where the exception was thrown..
Please let me know if I am doing something wrong.
OracleConnection Wrapper class
package ejbTesting;
// sql imports
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
// util imports
import java.util.Map;
import java.util.Properties;
// imports from Oracle Driver Classes
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleOCIFailover;
import oracle.jdbc.OracleSavepoint;
// import from Weblogic extensions
import weblogic.jdbc.extensions.WLConnection;
public class WeblogicConnectionWrapper implements OracleConnection
// oracle connection object
private OracleConnection connection;
public WeblogicConnectionWrapper (OracleConnection orclConnection)
try
this.connection = orclConnection;
catch(Exception unexpected )
unexpected.printStackTrace();
public OracleConnection unwrap()
try
// The datasource returns a weblogic.jdbc.pool.Connection
// This needs to be type casted to weblogic.jdbc.extensions.WLConnection
// Only this weblogic.jdbc.extensions.WLConnection CAN BE type casted
// to OracleConnection
return (OracleConnection) ((WLConnection) connection).getVendorConnection();
catch(Exception sqlException )
sqlException.printStackTrace ();
return null;
/* Implement all other methods by delegation to connection object */
public Connection _getPC()
return connection._getPC();
public void archive(int i, int j, String s)
throws SQLException
connection.archive(i, j, s);
public void assertComplete()
throws SQLException
connection.assertComplete();
public void clearWarnings()
throws SQLException
connection.clearWarnings();
public void close()
throws SQLException
connection.close();
public void commit()
throws SQLException
connection.commit();
public Statement createStatement()
throws SQLException
return connection.createStatement();
public Statement createStatement(int i, int j)
throws SQLException
return connection.createStatement(i, j);
public boolean getAutoClose()
throws SQLException
return connection.getAutoClose();
public boolean getAutoCommit()
throws SQLException
return connection.getAutoCommit();
public CallableStatement getCallWithKey(String s)
throws SQLException
return connection.getCallWithKey(s);
public String getCatalog()
throws SQLException
return connection.getCatalog();
public boolean getCreateStatementAsRefCursor()
return connection.getCreateStatementAsRefCursor();
public int getDefaultExecuteBatch()
return connection.getDefaultExecuteBatch();
public int getDefaultRowPrefetch()
return connection.getDefaultRowPrefetch();
public Object getDescriptor(String s)
return connection.getDescriptor(s);
public boolean getExplicitCachingEnabled()
throws SQLException
return connection.getExplicitCachingEnabled();
public boolean getImplicitCachingEnabled()
throws SQLException
return connection.getImplicitCachingEnabled();
public boolean getIncludeSynonyms()
return connection.getIncludeSynonyms();
public Object getJavaObject(String s)
throws SQLException
return connection.getJavaObject(s);
public DatabaseMetaData getMetaData()
throws SQLException
return connection.getMetaData();
public Properties getProperties()
return connection.getProperties();
public boolean getRemarksReporting()
return connection.getRemarksReporting();
public boolean getRestrictGetTables()
return connection.getRestrictGetTables();
public String getSQLType(Object obj)
throws SQLException
return connection.getSQLType(obj);
public String getSessionTimeZone()
return connection.getSessionTimeZone();
public int getStatementCacheSize()
throws SQLException
return connection.getStatementCacheSize();
public PreparedStatement getStatementWithKey(String s)
throws SQLException
return connection.getStatementWithKey(s);
public int getStmtCacheSize()
return connection.getStmtCacheSize();
public short getStructAttrCsId()
throws SQLException
return connection.getStructAttrCsId();
public boolean getSynchronousMode()
return connection.getSynchronousMode();
public int getTransactionIsolation()
throws SQLException
return connection.getTransactionIsolation();
public Map getTypeMap()
throws SQLException
return connection.getTypeMap();
public String getUserName()
throws SQLException
return connection.getUserName();
public boolean getUsingXAFlag()
return connection.getUsingXAFlag();
public SQLWarning getWarnings()
throws SQLException
return connection.getWarnings();
public boolean getXAErrorFlag()
return connection.getXAErrorFlag();
public boolean isClosed()
throws SQLException
return connection.isClosed();
public boolean isLogicalConnection()
return connection.isLogicalConnection();
public boolean isReadOnly()
throws SQLException
return connection.isReadOnly();
public String nativeSQL(String s)
throws SQLException
return connection.nativeSQL(s);
public Object openJoltConnection(String s, short word0, short word1)
return connection.openJoltConnection(s, word0, word1);
public void oracleReleaseSavepoint(OracleSavepoint oraclesavepoint)
throws SQLException
connection.oracleReleaseSavepoint(oraclesavepoint);
public void oracleRollback(OracleSavepoint oraclesavepoint)
throws SQLException
connection.oracleRollback(oraclesavepoint);
public OracleSavepoint oracleSetSavepoint()
throws SQLException
return connection.oracleSetSavepoint();
public OracleSavepoint oracleSetSavepoint(String s)
throws SQLException
return connection.oracleSetSavepoint(s);
public int pingDatabase(int i)
throws SQLException
return connection.pingDatabase(i);
public CallableStatement prepareCall(String s)
throws SQLException
return connection.prepareCall(s);
public CallableStatement prepareCall(String s, int i, int j)
throws SQLException
return connection.prepareCall(s, i, j);
public CallableStatement prepareCallWithKey(String s)
throws SQLException
return connection.prepareCallWithKey(s);
public PreparedStatement prepareStatement(String s)
throws SQLException
return connection.prepareStatement(s);
public PreparedStatement prepareStatement(String s, int i, int j)
throws SQLException
return connection.prepareStatement(s, i, j);
public PreparedStatement prepareStatementWithKey(String s)
throws SQLException
return connection.prepareStatementWithKey(s);
public void purgeExplicitCache()
throws SQLException
connection.purgeExplicitCache();
public void purgeImplicitCache()
throws SQLException
connection.purgeImplicitCache();
public void putDescriptor(String s, Object obj)
throws SQLException
connection.putDescriptor(s, obj);
public void registerApiDescription(String s, short word0, short word1, String
s1)
connection.registerApiDescription(s, word0, word1, s1);
public void registerSQLType(String s, Class class1)
throws SQLException
connection.registerSQLType(s, class1);
public void registerSQLType(String s, String s1)
throws SQLException
connection.registerSQLType(s, s1);
public void registerTAFCallback(OracleOCIFailover oracleocifailover, Object
obj)
throws SQLException
connection.registerTAFCallback(oracleocifailover, obj);
public void rollback()
throws SQLException
connection.rollback();
public void setAutoClose(boolean flag)
throws SQLException
connection.setAutoClose(flag);
public void setAutoCommit(boolean flag)
throws SQLException
connection.setAutoCommit(flag);
public void setCatalog(String s)
throws SQLException
connection.setCatalog(s);
public void setCreateStatementAsRefCursor(boolean flag)
connection.setCreateStatementAsRefCursor(flag);
public void setDefaultExecuteBatch(int i)
throws SQLException
connection.setDefaultExecuteBatch(i);
public void setDefaultRowPrefetch(int i)
throws SQLException
connection.setDefaultRowPrefetch(i);
public void setExplicitCachingEnabled(boolean flag)
throws SQLException
connection.setExplicitCachingEnabled(flag);
public void setImplicitCachingEnabled(boolean flag)
throws SQLException
connection.setImplicitCachingEnabled(flag);
public void setIncludeSynonyms(boolean flag)
connection.setIncludeSynonyms(flag);
public void setReadOnly(boolean flag)
throws SQLException
connection.setReadOnly(flag);
public void setRemarksReporting(boolean flag)
connection.setRemarksReporting(flag);
public void setRestrictGetTables(boolean flag)
connection.setRestrictGetTables(flag);
public void setSessionTimeZone(String s)
throws SQLException
connection.setSessionTimeZone(s);
public void setStatementCacheSize(int i)
throws SQLException
connection.setStatementCacheSize(i);
public void setStmtCacheSize(int i)
throws SQLException
connection.setStmtCacheSize(i);
public void setStmtCacheSize(int i, boolean flag)
throws SQLException
connection.setStmtCacheSize(i, flag);
public void setSynchronousMode(boolean flag)
connection.setSynchronousMode(flag);
public void setTransactionIsolation(int i)
throws SQLException
connection.setTransactionIsolation(i);
public void setTypeMap(Map map)
throws SQLException
connection.setTypeMap(map);
public void setUsingXAFlag(boolean flag)
connection.setUsingXAFlag(flag);
public void setWrapper(OracleConnection oracleconnection)
connection.setWrapper(oracleconnection);
public void setXAErrorFlag(boolean flag)
connection.setXAErrorFlag(flag);
public void shutdown(int i)
throws SQLException
connection.shutdown(i);
public void startup(String s, int i)
throws SQLException
connection.startup(s, i);
Util class to get Wrapped Connections from
datasource
package ejbTesting;
// j2ee imports
import javax.naming.InitialContext;
import javax.sql.DataSource;
// sql imports
import java.sql.Connection;
// imports from Oracle Driver Classes
import oracle.jdbc.OracleConnection;
* Wrapper class for the DataSource Connection from Weblogic pool
public class DataSourceConnectionWrapper
// datasource variable
private static transient DataSource datasource = null;
private static String dbName = "jdbc/workbench";
* Method that returns the database connection
public static Connection getConnection()
try
// initialsing the datasource object
initialiseDataSource ();
// Getting a connection from the datasource
Connection con = datasource.getConnection( );
// wrapping it custom wrapper class and
// returning the connection object
return new WeblogicConnectionWrapper((OracleConnection)con);
catch(Exception exception )
exception.printStackTrace();
return null;
private static void initialiseDataSource( ) throws Exception
if ( datasource == null )
try
InitialContext ic = new InitialContext( );
datasource = (DataSource) ic.lookup( dbName );
catch (Exception ne )
throw new Exception( "NamingException while looking up DataSource with
JNDI name" +
dbName + ": \n" + ne.getMessage( ) );
Exception Stack Trace
The line 46 in DataSourceConnectionWrapper
corresponds to
return new WeblogicConnectionWrapper((OracleConnection)con);
Which I feel is logical as the connection which we get from Weblogic
datasource cannot be type casted to OracleConnection
java.lang.ClassCastException: weblogic.jdbc.pool.Connection
at ejbTesting.DataSourceConnectionWrapper.getConnection(DataSourceConnectionWrapper.java:46) -
How to call a stored procedure using its package name in Oracle
hi
we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
i have got 2 queries:
1- How to call the stored procedure using it's package.
2- How to capture the In/Out parameter in the response.hi Prateek
thanks for the reply.
However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
How to get the IN-OUT parameter in XI? -
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
I am getting below error when i m trying to access oracle db using oracle 11g client. It works with earlier oracle client versions. how do i resolve this. is there any issue with version of ojdbc6.jar that i am using??? I cant use thin driver since its an old application for which i dont have source files.
Apr 6, 2013 1:00:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at PettyCash.SysDate.getSysSubSys(SysDate.java:232)
at org.apache.jsp.PettyCash.index_jsp._jspService(org.apache.jsp.PettyCash.index_jsp:186)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Code is as follow for reference
import oracle.jdbc.driver.*;
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,db_user, db_pass);
eNVIRONMENT VARIABLES set are as follows:
classpath
C:\Program Files\apache-tomcat-5.5.12\common\lib\servlet-api.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\classes12.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\ojdbc6.jar;
JAVA_HOME
C:\Program Files\Java\jdk1.5.0_04
PATH
C:\Program Files\Java\jdk1.5.0_04\bin
ORACLE_HOME
D:\Oracle11\product\11.2.0\client_1\BINApr 8, 2013 5:24:06 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.abc.index_jsp._jspService(org.apache.jsp.abc.index_jsp:280)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595) -
Sql_trace does not work for Java app using Oracle JDBC thin driver
Hi,
I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
Thanks in advance!Hi,
I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
Thanks in advance! -
I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
Please Advice!
Thanks in advance
AnuPamaHi Anupama,
First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
These are a few simple things that you should do in your JDBC program:
1. Import the necessary JDBC classes in your programs that use JDBC.
For example:
import java.sql.*;
import java.math.*;
2. Register the Oracle driver before before calling other JDBC APIs.
(This is not needed if you are using the JDBC Server-side Internal
Driver because registration is done automatically in the server.)
To register the Oracle driver, make sure the following statement
is executed at least once in your Java session:
DriverManager.registerDriver(
new oracle.jdbc.driver.OracleDriver());
3. Open a connection to the database with the getConnection call.
Different connection URLs should be used for different JDBC
drivers. The following examples demonstrate the different URLs.
For the JDBC OCI8 Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:oci8:@<database>",
"scott", "tiger");
where <database> is either an entry in tnsnames.ora or a SQL*net
name-value pair.
For the JDBC Thin Driver, or Server-side Thin Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@<database>",
"scott", "tiger");
where <database> is either a string of the form
<host>:<port>:<sid> or a SQL*net name-value pair.
For the JDBC Server-side Internal Driver:
Connection conn = DriverManager.getConnection(
"jdbc:oracle:kprb:");
Note that the trailing ':' character is necessary. When you use
the Server-side Internal Driver, you always connect to the
database you are executing in. You can also do this:
Connection conn
= new oracle.jdbc.driver.OracleDriver().defaultConnection();
Hope this helps,
Thanks,
Anupama wrote:
I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
Please Advice!
Thanks in advance
AnuPama--
Apurb Kumar -
Integrating Oracle APPS with APEX using popay_apex package...
Hi,
I am a newbie in APEX and tried to explore it only a few months back...
I must admit that this tool is Awesome..!!!
Also, I tried to integrate Oracle EBS 11i with APEX using [popay package |https://sites.google.com/a/popay.be/apex-on-apps/integration] and the integration was absolutely fantastic...!!!
h6. (Thanks Thierry for your impecabble work on developing and releasing this excellent package under BSD License !!!)
My question is,
I have created an Online Leave Application (OLA) in APEX which should retrieve the username from EBS Login and display the leave information of that particular user.
I have created the OLA in APEX and registered it in EBS as a form function and also attached it to a user responsibility.
When I run the form thru the EBS Responsibility logged in as a EBS user, the OLA Application opens in a new window...
But,
The username is retrieved as APPS instead of the user's login info.
because of this retrieval the global variable :APP_USER is storing the username as APPS and all my internal references with :APP_USER has been erroring with "NO DATA FOUND", since there is no user login as APPS.
Is there any way to overcome this bottleneck...?
Or Do I need to add any code in the APEX >Application >Security > VPD
Thanks in Advance...
BenHi,
I have solved the issue, Thanks to Rod & Thierry !
I have created a cookie to send the apps username to my APEX application.
(Added this code snippet in the popay_apex.start_application procedure)
--------<CODE>------------------------------------------
l_user := fnd_global.USER_NAME;
OWA_COOKIE.send
+(NAME=>'APEX',+
VALUE=>l_user,
path=>'/');
---------<ENDS>----------------------------------------
(Created an on-load before header process at page 1 and fetched the cookie value to an application item.)
-----------<CODE>-------------------------------------
DECLARE
c OWA_COOKIE.cookie;
a wwv_flow_global.vc_arr2;
BEGIN
c := OWA_COOKIE.get('APEX');
a := htmldb_util.string_to_table(c.vals(1));
+:F101_USER := a(1);+
EXCEPTION WHEN OTHERS THEN
NULL;
END;
-------------<ENDS>---------------------------------------
It's a mashup of Rod & Thierry's work....!
Hat's off to Rod & Thierry !
Ben
Maybe you are looking for
-
Issue : Training and Event Management
Hi, I have done configuration in Training and event management. I have created business event catalog(group,type,event(with date).When i was trying to book attendee for that event that asked assign training need so i have created Traing need(TN) an
-
Will the mini run on a Mac desktop
Just thinking it would be useful to have a second computer that can run thru my Mac desktop if it is possible-and use the screen.
-
Add Link to 3D Object in 9 Extended
I have been looking everywhere for info on adding a hyperlink to a 3D object in Acrobat 9 Extended to no avail. Any ideas on how to add a link so that when a user clicks on an object or group of objects it will open a browser to a predefined page? Se
-
Installing oracle 9i in windows 7
Hi, Can anyone help me how to install oracle 9i in windows 7.I tried installing and i got some errors and the installer closed
-
NB205 Win 7 - Speaker Mute and Unmute
Hi everyone, thanks for this thread -- indeed, very helpful. I have a different issue under Windows 7 -- I can never reliably mute or unmute the NB205. Even if I click the mute icon (after clicking the volume icon in the taskbar), sound still plays t