Can't get struct from Oracle via Weblogic DB connection?

There are two ways to connect oracle, within Weblogic or without Weblogic.
Without Weblogic way works. Code here:
import java.sql.Connection;
Class.forName("oracle.jdbc.driver.OracleDriver");
dbConn = DriverManager.getConnection("Connection");
StructDescriptor st = new StructDescriptor("Name of Object in Oracle ",dbConn);
Within Weblogic way doesn’t work. Code here:
import javax.naming.InitialContext;
import javax.sql.DataSource
import java.sql.Connection;
Connection conn = null;
javax.sql.DataSource ds = null;
ds = (javax.sql.DataSource) _cntx.lookup(poolName);
conn = ds.getConnection();
StructDescriptor st = new StructDescriptor("Name of Object in Oracle ",dbConn); // Error java.rmi.MarshalException: error marshalling return; nested exception is: java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
Reference:
http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html#1090291
I don’t know what the exact reason is. And my work is hanging by this thread. Could anyone help me pls? Thank you.

Man, what problem?
About how to use array,
CREATE TYPE department_type AS OBJECT (
DNO NUMBER (10),
NAME VARCHAR2 (50),
LOCATION VARCHAR2 (50)
CREATE TYPE dept_array AS TABLE OF department_type;
CREATE OR REPLACE PACKAGE objecttype AS
PROCEDURE insert_object (d dept_array);
END objecttype;
CREATE OR REPLACE PACKAGE BODY objecttype
AS
PROCEDURE insert_object (d dept_array)
AS
BEGIN
FOR i IN d.FIRST..d.LAST
LOOP
INSERT INTO department_teststruct
VALUES (d(i).dno,d(i).name,d(i).location);
END LOOP;
END insert_object;
END objecttype;
import java.sql.Connection;
import java.sql.DriverManager;
import oracle.jdbc.OracleCallableStatement;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;
import oracle.sql.STRUCT;
import oracle.sql.StructDescriptor;
public class TestStruct ...{
public static void main(String[] args)
sendStruct();
public static void sendStruct()
Connection dbConn = null;
try...{   
Object[] so1 = ...{"10","Accounts","LHR"};
Object[] so2 = ...{"20","HR","ISB"};
OracleCallableStatement callStatement = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
dbConn = DriverManager.getConnection("jdbc:oracle:thin:@ServerName:Port:ORa", "UserName", "Password");
StructDescriptor st = new StructDescriptor("DEPARTMENT_TYPE",dbConn);
STRUCT s1 = new STRUCT(st,dbConn,so1);
STRUCT s2 = new STRUCT(st,dbConn,so2);
STRUCT[] deptArray = ...{s1,s2};
ArrayDescriptor arrayDept = ArrayDescriptor.createDescriptor("DEPT_ARRAY", dbConn);
ARRAY deptArrayObject = new ARRAY(arrayDept, dbConn, deptArray);
callStatement = (OracleCallableStatement)dbConn.prepareCall("{call insert_object(?)}");
((OracleCallableStatement)callStatement).setArray(1, deptArrayObject);
callStatement.executeUpdate();
dbConn.commit();
callStatement.close();
catch(Exception e)...{
System.out.println(e.toString());
About how to do explain plan
EXPLAIN PLAN FOR
SELECT * FROM TABLE(DEPT_ARRAY(DEPARTMENT_TYPE(
1, --DNO NUMBER (10),
'NAME', --NAME VARCHAR2 (50),
'LOCATION' --LOCATION VARCHAR2 (50)
))) T
JOIN TABLE2 T2 ON T.DNO = T2.DNO;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
But if u want let Oracle know how many rows in that array, one way follows can help.
Usually way:
EXPLAIN PLAN FOR
SELECT * FROM TABLE(DEPT_ARRAY(DEPARTMENT_TYPE(
1, --DNO NUMBER (10),
'NAME', --NAME VARCHAR2 (50),
'LOCATION' --LOCATION VARCHAR2 (50)
))) T
JOIN TABLE2 T2 ON T.DNO = T2.DNO;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
1 Plan hash value: 1748000095
2
3 ----------------------------------------------------------------------------------------------
4 | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
5 ----------------------------------------------------------------------------------------------
6 | 0 | SELECT STATEMENT | | *8168* | 16336 | 24 (0)| 00:00:01 |
7 | 1 | COLLECTION ITERATOR CONSTRUCTOR FETCH| | | | | |
8 ----------------------------------------------------------------------------------------------
When add cardinality parameter there, the result will be correct.
EXPLAIN PLAN FOR
SELECT /*+ cardinality(t 10 ) */ * FROM TABLE(DEPT_ARRAY(DEPARTMENT_TYPE(
1, --DNO NUMBER (10),
'NAME', --NAME VARCHAR2 (50),
'LOCATION' --LOCATION VARCHAR2 (50)
))) T
JOIN TABLE2 T2 ON T.DNO = T2.DNO;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
PLAN_TABLE_OUTPUT
1 Plan hash value: 1748000095
2
3 ----------------------------------------------------------------------------------------------
4 | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
5 ----------------------------------------------------------------------------------------------
6 | 0 | SELECT STATEMENT | | 10 | 20 | 24 (0)| 00:00:01 |
7 | 1 | COLLECTION ITERATOR CONSTRUCTOR FETCH| | | | | |
8 ----------------------------------------------------------------------------------------------

Similar Messages

  • Audigy 4 Pro - can only get 2 channel sound via SPDIF/optical connecti

    I have two PC's, one with an Audigy 4 Pro and one with an Audigy 2 Platinum (A2P), I have my 5. speakers hooked up to the A2P and the A4P connected via the SPDIF to the A2P, I would expect to get 5. - both are setup to use 5. speakers, (I know that as a standard Digital coax/optical connections should handle multi speaker configs my entire A/V sound system (7. Dolby) uses optical and coax and it works fine).
    If I run the channel test on the Audigy 4 I can get nothing but sound through the left and right speakers, if I run the test on the Audigy 2 (speakers direct connected) the sound is fine, if I reconnect the speakers to my Audigy 4 I get sound on all speakers so it looks like its an issue with the SPDIF and optical inputs (I tried both).
    I have emailed tech support, I'm waiting for them to come back and tell me that the Audigy 4 cannot transmit more than two channels down the SPDIF/optical outs, thats my suspicion anyway, if that is the case then I'm not going to be a happy man and the Audigy will be going back to the store. Could be a driver problem of course as I cant believe they would implement Dolby and THX and only transmit two channels on the optical outs, that would be a bit dumb considering the primary use for digital connections is sound system interconnects.
    Anyone with any ideas about this let me know, perhaps theres a hidden setting somewhere or a registry setting that switches the digital outs to carry all signals.

    Just before everyone kicks off, heres a response I got from a tech guy at Creative themselves.
    If you connect speakers to your sound card using a digital cable
    (RCA/SPDIF or optical) then the software speaker test will only output
    from two speakers. The reason for this is that the speaker test signal is
    not in AC3 nor DTS format.
    The signal on a digital connection is either
    Optical SPDIF - which is either Stereo PCM signal or AC-3/DTS Bitstream
    RCA SPDIF - which is either Stereo PCM signal or AC-3/DTS Bitstream
    If you play AC3 (Dolby Digital) or DTS encoded signals, the amplifier
    decodes this and outputs it to all 6 speakers (5 satellites & subwoofer)
    discretely.
    When playing back stereo signals (such as Wav/CD Audio or MP3/WMA files)
    the amplifier may generate 5. output based on the incoming stereo PCM
    signal, provided Dolby Pro Logic decoding is available and activated.
    Therefore the speaker test should not be relied on when using RCA or
    Optical digital connections.
    This applies to all speaker systems equipped with RCA or Optical digital
    connections.
    This makes sense to me and I'm pretty happy with it, basically as the reply says above the speaker test does not encode to AC3 hence if you hook two Audigys together and run the test you only get 2 channel output, if you play a DVD which is AC3/DTS encoded on one Audigy and listen to speakers hooked up to the other when both Audigys are connected via SPDIF or optical you should in theory get full playback on all speakers. Hopefully
    Cheers
    Simon

  • How to send JMS message from oracle to weblogic

    Hello,
    I am facing with a problem of sending jms message from oracle to weblogic. I am using oracle 10g and weblogic server 9.1. Here is the problem. I would like to create a trigger to send JMS message to weblogic server whenever there is an update in oracle database. So I created a java class that will send a jms message to weblogic server. But in that class I use the jndi from weblogic: weblogic.jndi.WLInitialContextFactory
    when I use the loadjava utility to load that class into oracle, the status of that class is invalid though this class is working fine in eclipse with the weblogic.jar included. I was thinking because the jndi from weblogic needs the weblogic.jar in order to work, then I loaded that jar file into oracle (it took about 20 minute to load everything) and everything loaded into oracle from that jar file is invalid and missing some reference.
    So my question is: how do I send a jms message from oracle to weblogic using a java class with the right jndi?
    Any help will be appreciated.
    Thanks
    TL

    It should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
    Ensure that you set the following properties before getting your initial context:
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://node:7001 (or whatever)
    this will ensure that the correct JMS implementation classes are invoked.
    You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc.

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How to get information from Oracle's views

    Hi,
    I need to get information from Oracle's views about:
    * in which table's column is set index
    * what type of index is on this column
    * name of a trigger which exist on a table
    * type of trigger (before, after etc)
    * trigger status (enable, disable)
    Thanks for help.

    Hi..
    One of the best way to know which views to use is doing select * from dict where table_name like 'xxx';
    For example in your case you needed to know about the indexes and triggers so
    SQL> select * from dictionary where table_name like 'DBA_IND%';
    TABLE_NAME                     COMMENTS
    DBA_INDEXES                    Description for all indexes in the database
    *DBA_IND_COLUMNS                COLUMNs comprising INDEXes on all TABLEs and CLUSTERs*
    DBA_IND_EXPRESSIONS            FUNCTIONAL INDEX EXPRESSIONs on all TABLES and CLUSTERS
    DBA_INDEXTYPES                 All indextypes
    DBA_INDEXTYPE_COMMENTS         Comments for user-defined indextypes
    DBA_INDEXTYPE_ARRAYTYPES       All array types specified by the indextype
    DBA_INDEXTYPE_OPERATORS        All indextype operators
    DBA_IND_PARTITIONS
    DBA_IND_SUBPARTITIONS
    DBA_IND_STATISTICS             Optimizer statistics for all indexes in the database
    10 rows selected.
    SQL> select * from dictionary where table_name like 'DBA_TRI%';
    TABLE_NAME                     COMMENTS
    DBA_TRIGGERS                   All triggers in the database
    DBA_TRIGGER_COLS               Column usage in all triggers
    Reading the comments you can know which view to use, then  describe the view and use what you need

  • How to get data from Oracle to SAP

    Hi All,
           I want to get data from Oracle to my internal table in SAP,
    I worked on puting  the data from SAP to Oracle, it's working fine...
    Can anybody suggest the code for accessing from Oracle with 4 primary keys in oracle.
    regards
    manish

    hi
    good
    there is two things in sap open sql and native .if you ll use the open sql than you can access any database.
    thanks
    mrutyun

  • How can i return object from oracle in my java code using pl/sql procedure?

    How can i return object from oracle in my java code using pl/sql procedure?
    And How can i returned varios rows fron a pl/sql store procedure
    please send me a example....
    Thank you
    null

    yes, i do
    But i can't run this examples...
    my problem is that i want recive a object from a PL/SQL
    //procedure callObject(miObj out MyObject)
    in my java code
    public static EmployeeObj callObject(Connection lv_con,
    String pv_idEmp)
    EmployeeObj ret = new EmployeeObj();
    try
    CallableStatement cstmt =
    lv_con.prepareCall("{call admin.callObject(?)}");
    cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
    //registerOutParameter(int parameterIndex, int sqlType,String sql_name)
    cstmt.execute();
    ret = (EmployeeObj) cstmt.getObject(1);
    }//try
    catch (SQLException ex)
    System.out.println("error SQL");
    System.out.println ("\n*** SQLException caught ***\n");
    while (ex != null)
    System.out.println ("SQLState: " + ex.getSQLState ());
    System.out.println ("Message: " + ex.getMessage ());
    System.out.println ("Vendor: " + ex.getErrorCode ());
    ex = ex.getNextException ();
    System.out.println ("");
    catch (java.lang.Exception ex)
    System.out.println("error Lenguaje");
    return ret;
    Do you have any idea?

  • Airport & Can't get video from the camera

    Ok, So I've been reading through the discussions trying to figure out what's wrong, and then how to fix it. I keep getting error "Can't get video from the camera"
    Here's my setup: OSX 10.4.4 on 1 Ghz PB. iChat 3.1.1, I'm connecting using a Dazzle Hollywood DV Bridge with an analog camcorder attached. I can get a video preview, but no video chats.
    My connection is via a DSL modem (Cisco 725) and my ISP says all the ports needed for iChat are not blocked. my local network goes from the Cisco to an Airport (dual ethernet) which then distributes the IP addresses.
    I've read that airports need to be switched so that they do not control the IP addresses, but when I do that my network stops working. Is there any way around disabling the NAT on the airport?
    PowerBook G4 1MHz/1Gb   Mac OS X (10.4.4)  

    Hi EdM
    I think that I'm starting to see the light... Let me see if I have this right.
    My PB has an IP of 10.0.1.4 via Sys Prefs, etc..
    And the Airport is 10.0.1.1 and is distributing IP addresses (hence the 10.0.1.x IP numbers - right)
    Yep (so far)
    So using Terminal I need to type:
    set net entry add 10.0.1.4 5060 udp
    ...and so on...
    Nope. You need to have Distributing Addrress deselected in the Airport if it is in the link
    With the Modem doing DHCP you should get an IP from it (mostly 10.0.0.3 as the Airport will also be given one)
    Once the Modem's issued IP appears on the Mac then you log on to the modem (10.0.0.1) in Terminal, and Forward the ports to the IP the Mac gets.
    Your wife's PC is also likely to need some ports open for her Apps and this will be a different IP.
    I have only brought some of the details from the Port Forward site so I would make sure you check any Read Me or manual (On the CD ? web site ?) that might give you more clear instructions.
    I would set it up with the Airport Out of the loop first as this will confirm the modem is in DHCP mode (you will not get an IP otherwise).
    9:48 PM Thursday; February 16, 2006

  • How get support from oracle for reports6i

    how get support from oracle for reports6i

    If you have support contract with Oracle, you can use this site:
    http://www.metalink.oracle.com
    or for more information
    http://www.oracle.com/support/premier/global-support-resolution/metalink.html

  • When a program gets disconnected  from ORACLE?

    Hi all,
    I have written an proc program .I have to handle the disconnection from oracle in the
    middle of a program.
    Can any one tell me what are the majour/important cases in which a program gets disconnected from oracle and also how to test these cases.
    Please help me in this regard ,
    Thanks in advance,
    Trinath Somanchi,
    Hyderabad.

    there is some OP report after Windows update Dec 2014 macro stop responding ( I cant confirm if this is also related to your issue) its because security update for Office maybe conflict with the active-x that you are installed
    try to
    Close Excel
    Start Windows Explorer.
    Select your system drive (usually C:)
    Use the Search box to search for *.exd
    Delete all the files it finds.
    Start Excel again
    Open that file and save it, and try open at Windows 7
    to get more detail about this issue, I suggest also contact Office forum
    this case also will be solve installing kb3025036
    good luck

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • Get date from Oracle when local time zone is different from Oracle time zon

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send e.g. 28.06.2002, but in Oracle date is save as 27.06.2002 01:00 (hour=01 , I suppose that is because java.sql.Date hasn't time the Oracle set it time = time zone=+1) And when I get date from Oracle I get incorrect date. In SQL I don't use date masks. Maybe solution is to use java.sql.Timestamp object (when save date to Oracle) instead of java.sql.Date?
    But if I save date at e.g. 01:00 clock and send e.g. 28:06.2002 in Oracle, date is save as 28.06.2002 01:00 and when I read from Oracle I get correct date.
    Thank you.

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send
    e.g. 28.06.2002, but in Oracle date is save as
    27.06.2002 01:00 (hour=01 , I suppose that is because
    java.sql.Date hasn't time the Oracle set it time =
    time zone=+1) Presumably you are using setTimestamp() to store the value. If you are explicitly using a varchar (string) then you will have to correct the timezone your self.
    And when I get date from Oracle I get
    incorrect date. In SQL I don't use date masks. Maybe
    solution is to use java.sql.Timestamp object (when
    save date to Oracle) instead of java.sql.Date?The method setDate/getDate store a 'date' which is not the same as a 'date and time' for which setTimestamp/getTimestamp are used.
    But if I save date at e.g. 01:00 clock and send e.g.
    28:06.2002 in Oracle, date is save as 28.06.2002
    01:00 and when I read from Oracle I get correct date.
    Thank you.

  • HT203167 lost my hard drive how can i get songs from ipod back to new computer

    I lost my hard drive and want to get my music back on my new computer. How can I get songs from my ipod to my computer? I am afraid to sync it and losing what is on my ipod. Any help would be appreciated.

    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Use your backup copy to put everything back.
    If for some reason you have failed to maintain a backup, not good, then you can transfer itunes purchases from your ipod:  File>Transfer Purchases

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

Maybe you are looking for