Cannt execute stored proc of one schema in another schema from java app.

I am posting my problem in this forum as i i though it could be server-independent.
I am working on apache tomcat and spring framework with Oracle db (schema/user A)
We access oracle db from our java application by setting jndi and works fine.We have sqlstatements, stored procs and functions all run fine.
Now we create a role (DBROLE) with all permissions to that original db schema/user(A) . We created another empty schema B and assigned that role(DBROLE) to that user B.
(We grant all kind of permissions on tables/packages of schema A to user role DBROLE and also created synonyms)
Intentions are: to access the schema A though schema B from application and avoiding direct access.
In our spring application, we replaced database-settings with schema B.
Things work fine: When its plain SQL statement is run from Java code but Stored proc wont run and we get
'Wrong num of arguments/data types' error.
Also all stored procs are in packages.To execute stored proc in java code, we use SimpleJdbcCall.
I also checked run stored proc from schema B and its works. Only from web app, it doesnt work.
Please suggest,what should be done to make this working or if there is other alternative.
Thanks

Instead of importing a scema in another schema specifiy the schemas in the external-schemaLocation property.
SAXParser saxParser = new SAXParser();
saxParser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", "xmlschema1.xsd, xmlschema2.xsd");

Similar Messages

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • Best LKM to move data from with in Oracle from one schema to another Schema

    Hi Gurus,
    What is the best KM to move data from one schema to another schema within same oracle database.
    Thanks in advance

    Dear,
    If your source and target are on the same database server then you dont need LKM.
    You have to 1. create one data server for the database server
    2. Create one physical schema for your source and another physical schema for your target under the above created data server.
    3. Then create models for each above created physical schema
    In this case you just need IKM knowledge module
    Please refer http://oditrainings.blogspot.in/2012/08/odi-interface-source-target-on-same.html
    If your source and target are on different server then you must create two different data servers in topology. You have to use LKM.
    The best LKM to use is LKM oracle to Oracle dblink. But you should have proper grants to use it
    If your source has very few records you can go with LKM SQL to Oracle other wise use LKM oracle to Oracle dblink

  • Export One Schema to Another Schema

    Hi
    I would like to export some of my tables from one schema to another schema.
    Can you help me on this
    regards
    Ghouse

    Here you resuire two steps EXPORT AND IMPORT
    STEP-1
    First run the export utility (name EXP80.EXE) in the ORANT\BIN directory and make the .DMP file.
    STEP-2
    Secondly run the import utility (name IMP80.EXE) in the ORANT\BIN directory and call the above .DMP file
    ===============
    THE END
    ===============

  • How to create a stored procedure that accepts an array of args from Java?

    I am to be creating a stored procedure that accepts an array of arguments from Java. How to create this? thanks
    Sam

    Not a PL/SQL question really, but a Java one. The client call is done via ThinJDBC/OCI to PL/SQL, This call must be valid and match the parameters and data types of the PL/SQL procedure.
    E.g. Let's say I define the following array (collection) structure in Oracle:
    SQL> create or replace type TStrings as table of varchar2(4000);
    Then I use this as dynamic array input for a PL/SQL proc:
    create or replace procedure foo( string_array IN TStrings )...
    The client making the call to PL/SQL needs to ensure that it passes a proper TStrings array structure.. The Oracle Call Interface (OCI) supports this on the client side - allowing the client to construct an OCI variable that can be passed as a TStrings data type to SQL. Unsure just what JDBC supports in this regard.
    An alternative method, and a bit of a dirty hack, is to construct the array dynamically - but as this does not use bind variables, it is not a great idea.
    E.g. the client does the call as follows: begin
      foo( TStrings( 'Tom', 'Dick', 'Harry' ) );
    end;Where the TStrings constructor is created by the client by stringing together variables to create a dynamic SQL statement. A bind var call would look like this instead (and scale much better on the Oracle server side):begin
      foo( :MYSTRINGS );
    end;I'm pretty sure these concepts are covered in the Oracle Java Developer manuals...

  • Administrate Objects in Schema by Another Schema

    Hi,
    I am in a scenario to give administer privilege on one schema to another schema only.
    Let me exxplain my scenario with an example.
    I have a schema named HR in my database. Now I have create another schema named SH.
    Now I need to do all operations like create table, create procedure etc on HR schema from SH schema.
    And please note that I can't give create any table, create any procedure etc as it will be a big security breach.
    Please help me to sort out this issue.
    Regards,
    Savad

    user9292816 wrote:
    Hi,
    I am in a scenario to give administer privilege on one schema to another schema only.
    Let me exxplain my scenario with an example.
    I have a schema named HR in my database. Now I have create another schema named SH.
    Now I need to do all operations like create table, create procedure etc on HR schema from SH schema.
    And please note that I can't give create any table, create any procedure etc as it will be a big security breach.
    AFAIK , without create any table/ or any any super privilege like DBA etc , you cannot achieve this.
    Regards
    Rajesh

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Runtime exception java.lang.ClassNotFoundException on executing Stored Proc

    I am getting the below error when I try to execute a stored proc in Pointbase from weblogic.
    java.sql.SQLException: The external "DbLog::insLog" routine had the following runtime exception "java.lang.ClassNotFoundException: DbLog"
    import java.sql.*; import com.pointbase.jdbc.*; public class DbLog { static Connection conn = null; static Statement m_stmt; static Statement l_stmt; static CallableStatement m_callStmt = null; public boolean logPreAuth() { try { String I_URL = "jdbc:pointbase:server://localhost:9093/weblogic_eval"; conn = DriverManager.getConnection(I_URL, "PBSYSADMIN", "PBSYSADMIN"); /*String SQL_CREATE_PROC = "CREATE PROCEDURE insLog(IN P1 VARCHAR(30))" + " LANGUAGE JAVA" + " SPECIFIC insLog" + " DETERMINISTIC" + " NO SQL" + " EXTERNAL NAME \"DbLog::insLog\"" + " PARAMETER STYLE SQL"; m_stmt = conn.createStatement(); m_stmt.executeUpdate(SQL_CREATE_PROC); m_stmt.close(); */ Commented out because it throwed error saying, The routine "INSLOG" in schema "PBPUBLIC" already exists in system table SYSROUTINES. m_callStmt = conn.prepareCall("{ call insLog(?) }"); m_callStmt.setString(1, "Success!!"); m_callStmt.execute(); } catch (Exception e) { logger.error("Error in logPreAuth method" + e); } return true; } public static void insLog(String test) { try { l_stmt = conn.createStatement(); l_stmt.executeUpdate("Insert into logs values('" + test + "')"); l_stmt.close(); conn.close(); } catch (Exception e) { } }
    Please let me know how to solve this.

    I setted the classpath in commEnv.cmd as follows,
    set POINTBASE_HOME=%WL_HOME%\common\eval\pointbase
    set POINTBASE_CLIENT_CLASSPATH=%POINTBASE_HOME%\lib\pbclient57.jar
    set POINTBASE_CLASSPATH=%POINTBASE_HOME%\lib\pbembedded57.jar;%POINTBASE_CLIENT_CLASSPATH%;C:\bea\user_projects\workspaces\work1\utility\build\classes
    set POINTBASE_TOOLS=%POINTBASE_HOME%\lib\pbtools57.jar
    My DbLog class in the path, C:\bea\user_projects\workspaces\Work1\util\build\classes\net\local\util\common
    FYI, net\local\util\common is the package.
    But when I try to execute the page which calls RequestFilter.java, I am getting the following error,
    Error 500--Internal Server Error
    java.lang.NoClassDefFoundError: Could not initialize class net.local.util.common.DbLog
    Please find the code below,
    --RequestFilter.java
    import net.local.util.common.DbLog;  
    public final class RequestFilter {  
    public void log() {  
    DbLog dblog = new DbLog();  
    dblog.logPreAuth();  
    }  --DbLog.java
    package net.local.util.common;  
    import java.sql.*;  
    import org.apache.log4j.Logger;  
    import com.pointbase.jdbc.*;  
    public class DbLog {  
        private static final Logger logger = Logger.getLogger(DbLog.class);  
        private static boolean DEBUGGING = logger.isDebugEnabled();  
        private Connection conn = null;  
        private Statement m_stmt;  
        private Statement l_stmt;  
        private CallableStatement m_callStmt = null;  
        //static ResultSet l_rs = null;  
    public DbLog() {  
        logger.info("DbLog constructor called");  
        init();  
    public void init() {  
        logger.info("DbLog init called");  
    public void logPreAuth() {  
            try {  
                logger.info("Inside logPreAuth method");  
                String I_URL = "jdbc:pointbase:server://localhost:9093/weblogic_eval";  
                Class.forName("com.pointbase.jdbc.jdbcUniversalDriver").newInstance();  
                //Class.forName("com.pointbase.jdbc.jdbcDataSource");  
                conn = DriverManager.getConnection(I_URL, "PBPUBLIC", "PBPUBLIC");  
            String SQL_CREATE_PROC = "CREATE PROCEDURE insLog(IN P1 VARCHAR(30))" 
                    + " LANGUAGE JAVA" 
                    + " SPECIFIC insLog" 
                    + " DETERMINISTIC" 
                    + " NO SQL" 
                    + " EXTERNAL NAME \"DbLog::insLog\"" 
                    + " PARAMETER STYLE SQL";   
                m_stmt = conn.createStatement();  
                m_stmt.executeUpdate(SQL_CREATE_PROC);  
                m_stmt.close();    
                m_callStmt = conn.prepareCall("{ call PBPUBLIC.insLog(?) }");  
                m_callStmt.setString(1, "Success!!");  
                m_callStmt.execute();   
            catch (Exception e) {  
                logger.error("Error in logPreAuth method" + e);  
    public void insLog(String test)  
        try {  
            l_stmt = conn.createStatement();  
            l_stmt.execute("Insert into logs values('" + test + "')");  
            l_stmt.close();  
            conn.close();  
        catch (Exception e) {  

  • Calling stored proc (with 2 IN and 3 OUT) - from SQL Plus

    This is the signature of my stored proc:
    CREATE OR REPLACE PROCEDURE myschema.myproc
       p_usr_name     IN  VARCHAR2,    
       p_send_tmstmp  IN  DATE,    
       p_ret_value    OUT NUMBER,
       p_err_code     OUT VARCHAR2
    )If I need to call it from sql plus, how do I need to pass the arg?
    This is what I am doing
    execute myschema.myproc('abc123','02-MAY-2008');
    What is wrong here? If someone could help. Thx!

    Try something like this
    var usr_name    varchar2(30)  
    var send_tmstmp varchar2(11)  
    var ret_value   number
    var err_code    varchar2(10)
    begin
    :usr_name    := 'abc123';
    :usr_name := '02-MAY-2008';
    myschema.myproc ( p_usr_name           => :usr_name,
                      p_send_tmstmp        => TO_DATE( :usr_name, 'DD-MON-YYYY' ),
                      p_ret_value          => :ret_value,
                      p_err_code           => :err_code);
    end;
    print ret_value;
    print err_code;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Move tables from one schema to another schema

    Hi All,
    I have some tables in on Production schema. I would like to move these tables (including all constraints,triggers,indexes-- whatever created on these tables) to Development environment .
    Could you please guide me how to do this.
    My Oracle Version is 11.2.0.3 and I am using Toad.
    Thanks.
    Edited by: 966949 on Mar 29, 2013 10:19 AM

    966949 wrote:
    Hi All,
    I have some tables in on Production schema. I would like to move these tables (including all constraints,triggers,indexes-- whatever created on these tables) to Development environment .
    Could you please guide me how to do this.
    My Oracle Version is 11.2.0.3 and I am using Toad.
    Thanks.
    Edited by: 966949 on Mar 29, 2013 10:19 AMsome, many, most professionals have application source code; which includes DDL for all object stored within code repository; like SUBVERSION;
    extract DDL from repository & apply against Development DB.
    Handle:     966949
    Status Level:     Newbie
    Registered:     Oct 22, 2012
    Total Posts:     257
    Total Questions:     58 (37 unresolved)
    I extend my condolences to you since you rarely get answers to your questions here.

  • Copy data from one schema to another schema tables

    Hi,
    I was doing a copy using sql developer copy feature, data copy worked perfect but for few table data didn't move there are about 30 tables from schema prod to schema dev i need to move tables are already created only data needs to be moved from prod to dev
    Can you suggest me any method were I can move all the tables data at a time from one schema to another. Please suggest.
    Thanks
    Sudhir

    Hi,
    If table structure is the same then:
    insert into dev.table_name
    select
    from
      prod.table_name  --if prod is in another database change to prod.table_name@db_link_to_prod_db
    commit
    ;Hope this helps. Otherwise give some more info about where these schema's are.
    Regards,
    Peter

  • Importing table data from one schema to another schema

    Hi All,
    I exported tablerows only of Schema A, and same I am trying to imported in Schema B.
    While importing I am getting oracle error "row rejected, Integrity constraint violated
    parent key not found".
    What I did is I disabled all the constraints through script in Schema B, and imported data. Data imported successfully, but while executing the enabling the constraints script in Schema B constraints are not enabled due to parent and chile relationship problems, even I executed this script many times.
    Note:- Schema A and Schema B are same structure, Schema A contains data but
    Schema B does not
    Can any body have any idea on this?
    Thanks,

    Hi,
    But I want data to be completely imported without losing.
    I am trying to disable the constraints using the following queries for enabling and
    disabling
    select 'ALTER TABLE '||A.TABLE_NAME||' DISABLE CONSTRAINT '||B.CONSTRAINT_NAME||';'
    FROM user_constraints A, USER_CONSTRAINTS B
    WHERE A.TABLE_NAME = B.TABLE_NAME
    AND A.CONSTRAINT_TYPE = 'P'
    Foreign constraints  -
    select 'ALTER TABLE '||A.TABLE_NAME||' DISABLE CONSTRAINT '||B.CONSTRAINT_NAME||';'
    FROM user_constraints A, USER_CONSTRAINTS B
    WHERE A.TABLE_NAME = B.TABLE_NAME
    AND A.CONSTRAINT_TYPE = 'R'
    -- Check constraints ---
    select 'ALTER TABLE '||A.TABLE_NAME||' DISABLE CONSTRAINT '||B.CONSTRAINT_NAME||';'
    FROM user_constraints A, USER_CONSTRAINTS B
    WHERE A.TABLE_NAME = B.TABLE_NAME
    AND A.CONSTRAINT_TYPE = 'C'

  • Accesing the tables of one schema in another schema

    Hi
    I have doubt .. suppose i have a user called DEMO and it has tables . now i have a another user called DEMO1
    my doubt is . how can i get the tables of DEMO user into DEMO1. If update the table in DEMO1 that should reflect
    in DEMO user. help me.........

    Before going further, you should clarify your requirements and make sure you have a good understanding of:
    - Synonyms
    - Views
    - Replication such as materialized views
    - Basic security including object grants
    Assuming this is all in the same database...
    If you just need to have one user access data in another schema, you need grants.
    If you need to make it 'look like' the data in that other schema is in your schema, you should be looking at synonyms or views.
    If you need to capture the data periodically from the other schema, you should be looking at materialized views.
    If you are straddling multiple databases then the choices may be less clear-cut but you should still be looking at these capabilities to assemble a solution
    From what you have said so far, triggers should not even be on your radar.

  • Grant access to all the views created in user schema to another schema

    How to grant access for all the views created in own HAGGIS schema to comqdhb schema on the HAGGIS database.
    Oracle Grant Privileges
    ===============
    Object privileges assign the right to perform a particular operation on a specific object
    I read that we can use select 'grant select on' ||view_name||'HAGGIS' user_views where owner='COMQDHB'
    Is this right
    Oracle System Privileges
    ===============
    System privileges should be used in only cases where security isnt important,because a single grant statement could remove all security from the table
    Role based security
    ============
    Role security allows you to gather related grants into a collection-since the role is a predefined collection of privileges that are grouped together.privileges are easier to assign to users.
    [http://www.dba-oracle.com/art_builder_grant_sec.htm]
    can we grant select update to all the views at a time to the other schema.
    Are there any other ways to secure the data other than creating users and assigning roles.
    Thank you
    Edited by: Trooper on Dec 23, 2008 9:24 AM

    I think what was suggested was that you use SQL to generate the grants on each and every view, that is, you use SQL to generate SQL where the SQL being generated is "grant select on view_name to role'"
    If you users to connect to Oracle you have to create usernames for them though if the users only connect via an application the application might run just as one user and access to the application is controled via application security. The control on the application can be via Directory Services such as OID or MS Active Directory. User access to Oracle can also be controlled via OID.
    To connect to Oracle you can use OS authenication (not recommended), usernames with passwords, or via Advanced Security Option which supports single sign-on products like Kebros or Oracle Internet Directory etc....
    Example using SQL to generate SQL
    How do I find out which users have the rights, or privileges, to access a given object ?
    http://www.jlcomp.demon.co.uk/faq/privileges.html
    HTH -- Mark D Powell --

Maybe you are looking for

  • IPhone remote for iPad

    Hi there Does anyone know if it's possible to set up the iPhone as a remote for the iPad? I have my music collection on my iPad which is plugged into my home hifi and would like to be able to make music selections on the iPad using the iPhone as a re

  • Lost music on ipod after reinstall of itunes

    I've been upgrading to Win XP from Win ME. Had to start all over back to factory restore. Lost i tunes library, but that was ok because it was on ipod. Re-installed itunes and downloaded upgrade for itunes and ipod. Downloaded/installed fine. Hooked

  • Customized fields Not visible in GUI but visible in PCUI why

    Hi,   Can anybody help me, i have a problem which is as followes, I Enhanced Three fields for Campign in CRM Throw EEWB, these three fields are not appearing in GUI but its appearing in PCUI.  Can some body can give me  valueble inputs to solve this

  • Import tab delimited data in livecycle designed form

    Hello, Is it possible to import tab delimited data in livecycle designed xdp form? Also will it work when we user right enable form so that user can import their data in PDf form? Thanks Manoj

  • My password keep change on my email account once I closet them and come back last to login

    Is safari-net-help.com a real company of not. Safari went $35.00 to check my system by credit card. My password keep change on my email account once I closet them and come back last to login Still waking on the answer to my question. Thx I will wake