Serializing objects with arrays - JDBC

Hello,
Are there any known issues with serializing arrays into Blobs with JDBC?
I have an object with a complex array. It’s basically name/value pairs, but the values
can be arrays as well. The type of the values array can be of different types, i.e. string, Boolean, int, etc. These arrays are a unioned, and a discriminator identifies what type of array I have.
Array (name, value.discriminator, value) where the value is also an array of some type.
An example of some data would be.
Name = ‘Employee Name’ values = { ‘Fred’} discriminator = StringType
Name = ‘address’ values = { ‘addr1’, ‘addr2’, ‘addr3’} discriminator = StringType
Name = ‘Insured’ values = {true} discriminator = booleanType
Name = ‘Some_Int_values’ values = {1,2,3,4} discriminator = IntegerType
Name = ‘SomeOther_Int_values’ values = {1,2,3,4} discriminator = IntegerType
It does not need to be that complex… it might just be
Name = ‘Employee Name’ values = { ‘Fred’} discriminator = StringType
The issues I’m having is before I serialize the object and write it into a blob, I can repeat through the length of the outer array and print the value arrays. After I read the object for the blob, I cannot do this. It seems to have a problem identifying the discriminator type.
Thanks!

421780,
Sounds like a good candidate for XML. Have you considered that? Have you seen Oracle's XML Technology Center?
Good Luck,
Avi.

Similar Messages

  • Serializing objects with the NIO API

    I try to use the new IO API to implement a non-blocking multi-threaded server that communicates with client applications by exchanging serialized objects. I started from the code in the JavaWorld article at http://www.javaworld.com/javaworld/jw-09-2001/jw-0907-merlin.html .
    With the new features of J2SDK 1.4.0, you don't have to create a separate thread per connected client. That is a big improvement.
    But when I read an object with ObjectInputStream, I get a java.nio.channels.IllegalBlockingModeException.
    Has anybody successfully implemented such a server since the release of the new io API?
    Thanks.
    Jean-Robert

    The ObjectStream code is basically incompatible with non blockin I/O since you must block on the stream until a whole Object is available. You could roll something like this yourself, by reading bytes until there are enough available to build the next object and then getting that Object from the buffer and shipping it to your client thread. All of this is far more trouble than just using the Stream oriented I/O.
    NIO and mutilple threads are a nightmare, the whole idea of non-blocking I/O is to avoid needing multiple threads. If you do use multiple threads you will need queues between them. See the Taming the NIO Circus topic for lots of discussion of NIO and its problems. The system seems more stable in JDK 1.5, but most people haven't even started using 1.4 for production yet.
    Personally I avoid ObjectStreams. They are only useful between Java applications, if I want that I just use RMI and let Java do ALL the hard work. When I write a Socket based app, its probably because the other end is a mainframe of a C program. For that reason I send data as bytes, packaged up in packets, and encode as XML or ASN.1 so the other end can interpret it.

  • RMI - Serializing Object with the right constructor..?

    Hello, I am trying to usr RMI to send an object that I serialized but I have further porblems than that. The Object that I am using is called FileLineReader and it Extends Buffered Reader. SInce Buffered Reader is not Serializable, I implemented Serializable within FileLineReader, so that I can send it through the RMI.
    package musr.client.dbreader;
    import java.io.*;
    public class FileLineReader extends BufferedReader
              implements LineReader, java.io.Serializable {
    String pattern; // The string we are going to be matching.
    * Constructor
    * Passes the stream to our superclass
    public FileLineReader(Reader in) { super(in); }
    * This is the filter: call our superclass's readLine() to get the
    * actual lines, but only return lines that contain the pattern.
    * When the superclass readLine() returns null (EOF), we return null.
    public String matchLine(String pattern) throws IOException {
    String line;
    do { line = super.readLine(); }
    while ((line != null) && line.indexOf(pattern) == -1);
    return line;
    When I use this object to send it through RMI to the Server,
    (FileLineReader)inFile = (FileLineReader) obj.senddbFile(openFileTextField1.getText(),openFileTextField2.getText());
    I get an exception:
    GUI_RMI exception, error unmarshalling return; nested exception is: java.io.InvalidClassException: musr.client.dbreader.FileLineReader; no valid constructor.
    I am not sure what the problem is and I have been struggling with it for a while now. The constructor of BufferedReader takes one argument in so I have to pass FileLineReader an argument when I construct it. I think the RMI needs a constructor that takes no arguments and that causes problems. Is that true? In that case, I can't extend my class with BufferedReader.
    Or maybe the problem is somthing quite different. Anyone has any suggestions or comments, I'd appreciate help. Thanks Ivan

    You will have to create your own stream. (RMI is just a way to call reemote methods; it knows nothing about files or I/O.)
    1. You need a RemoteReader. This object should probably have 3 or so methods:
    Open(filename) Opens the file
    read reads a block from the file and returns it as a byte array.
    close()
    2. You need a RemoteInputStream object.
    o Instantiated on the client.
    o Makes calls to the RemoteReader.
    o Has some read methods and a close method.
    o Implements InputStream.
    With these two objects, you have enough underpinnings top - for example - wrap the RemoteINputStream in a BufferedReader or whatever you need.

  • Create Oracle Object with array inside

    Hi
    I want create a db type with an attribute of dbms_sql.varchar2_table  type
    Example:
    create or replace type t_obj_gest_csv_h
       as object
    column_value_list dbms_sql.varchar2_table,
    It's possible?
    Stefano

    Not with dbms_sql.varchar2_table. You can't reference PL/SQL types when creating SQL type. You can create SQL nested table type and use it in object type:
    SQL> create or replace
      2    type StringList
      3      as table of varchar2(4000)
      4  /
    Type created.
    SQL> create or replace
      2    type t_obj_gest_csv_h
      3      as object(
      4                id number,
      5                s  StringList
      6               )
      7  /
    Type created.
    SQL>
    SY.

  • Serializing object with its events

    Hi..
    I have serialized & de-serializaed a button in a Frame. The problem is after de-serialization, the events i defined on the button are not executed..Will you help me out on this problem? where am i making the mistake?
    Thanks.

    I have serialized & de-serializaed a button in a
    Frame.Why?
    The problem is after de-serialization, the
    events i defined on the buttonYou mean the listeners don't work?
    are not executed..Will
    you help me out on this problem? where am i making
    the mistake?You mean, besides not posting in the Swing forum? Not posting your code, I'd say.

  • Encrytiong serialized object and seald object

    Hello,
    At the moment I'm writing some code using serialized object stream encrytion. But lately I dicovered sth like sealed objects. My question is what is the difference between creating a SealedObject and then writting it to a stream and encrypting the serialized object as a stream?
    1. What is the purpose for SealedObject regarding the possibility of encrypting serialized objects with streams?
    2. Are there any differences in use of those two ways of securing objects?*
    Thanks for Your replies in advance
    DT

    Read it but not shure wht exactly do U mean. It doesn't ansewer mys questions: of what is the reason for usinf sealedobject where we can encrypt the object with the CipherInputStream (which I have posted as question 1 in the 1st post) and what are the differences in idea of use meaning where should we use CipherInputStream and where Seald object?

  • Finding objects in arrays, adding to a temp array and replace old with temp

    hi, I am currently modifying a hand analyser for a poker game. imagine a hand of a set of cards that can be from 5 up to whatever the game instructs, the analyser then has to match the hand to the rankings of best hands. so it has to map the hand to these possible besthands..
    Royal Flush (A,K,Q,J,10 of same suit)
    Straight flush(a running rank of same suit)
    4 of a kind(er... 4 of the same rank)
    full house(3 of a kind and a pair)
    flush(all same suit)
    straight(a running rank, A,2,3,4,5...,K)
    2 pair(a pair and a pair)
    1 pair(a pair)
    and a high Card(the highest card in a hand)
    the hand is sorted in ranks and suits to check for straights and flushes, and i have used a for loop to find any pairs, trips and quads for a hand. the problem i am having is the checking of two pairs. here is the loop i am using
    Hand temp = new Hand();//creates a temporary hand to place the matching cards into. hand is an array of cards.
          for (int i = 1; i < cards.size() - 1; i++) {//cards is the hand passed to be checked for two pairs
            if (cards.getCard(i).getRank() == cards.getCard(i + 1).getRank()) {
             /*checks if the card in i is the same as the next card, if true,
                then adds it to the temp hand.*/
              temp.addCard(cards.getCard(i));
              /*once the cards are passed to the temp hand,
                 it is removed from the cards hand.*/
              cards.removeCard(i);     
              temp.addCard(cards.getCard(i));
              cards.removeCard(i);
              System.out.println(temp + "check twopair");
              /*just a check to see if they are passed and removed from those hands
                 -- these work the first time around*/
              System.out.println(cards + "check remaining best hand");
            else if (temp.size() == 4) {
                /*if the temp hand as 4 cards, it means there are 2 pairs found,
                   it adds the next card in the cards hand as the kicker. since cards
                   is ranked by value, it will choose the highest card*/
              temp.addCard(cards.getCard(i));
    //a check to see if the card has been added to the hand
              System.out.println("adds the kicker to the 2 pair");
            if (temp.size() == 5) {
    //once the best cards have been dealt into temp, it is passed back to the hand, cards.
              kicker = (Card)temp.getCard(4);
              cards = temp;
              return true;
           /*if the check finds that there is no 2 pairs in the hands, the cards are set
              back to the original cards, and sorted by rank and passes over to the
              next test, which should be the check one pair*/
          cards = new Hand(originalCards);
          sortbyRank();
          return false;the loop finds the first pair alright, but coming around the second time, it doesnt seem to pick up on the second pair.
    in an example, consider a 7 card hand being passed to this analyser..
    3d, 7h, Ac, 3h, 6h, 7s, Kd. this gets sorted into ranks and become Ac, Kd, 7s, 7h, 6h, 3d, 3h. the first check would be the royal flush - lets ignore the way it works, and it fails anyway because the hand doesnt hold a royal flush, similarly, all the other tests will fail, from straight flush, 4 of a kind, full house, flush, straight, 3 of a kind and then we get to 2 pairs. in the first instance the loop will check Ac == K, it fails, and checks if the temp hand has 4, it fails and goes to i =2. it will check K to 7, fail and go to i = 3, 7h matches 7s, so puts that to temp, temp now equal 2, but not 4, so loops. this is where i messes up. it doesnt pick up the two pairs of 3s. any suggestions?

    I've never played poker so I had to look carefully at your question. This resulted in the following table. This suggests to me that any attempt at simplification will not be easy so I think I would have an analyser object with nine methods returning a boolean as to whether each test had been met. This seems a cleaner approach although it may be less efficient than your own.
                                                  Same   Same   Rank
                                                  Suit   Rank   Seq
    Royal Flush (A,K,Q,J,10 of same suit)           Y             Y
    Straight flush(a running rank of same suit)     Y             Y
    4 of a kind(er... 4 of the same rank)                  Y
    full house(3 of a kind and a pair)             0.5    0.5
    flush(all same suit)                            Y
    straight(a running rank, A,2,3,4,5...,K)                      Y
    2 pair(a pair and a pair)                              Y
    1 pair(a pair)                                         Y
    and a high Card(the highest card in a hand)

  • Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

    Hi,
    I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
    Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
    Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
    Since, I can't launch the ConnectIQ simulator app, I have this message in console :
    8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
    The data couldn’t be read because it isn’t in the correct format.
    <CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
    entries =>
      0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
      1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
    I have looked at this file and it looks like a binary plist
    bplist00ß^P^V^A^B^C^D^E^F^G^H
    ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi    on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE    xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph    oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos    TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^    A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
    I guess it is a normal format but my system seems to be unable to read binary plist ?
    I tried some stuff with plutil
    plutil -lint Info.plist
    Info.plist: Unexpected character b at line 1
    Same for convert
    plutil -convert xml1 Info.plist
    Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
    I also try to download a fresh version of the connectIQ SDK and no changes.
    Any idea ?
    Thanks

    Step by step, how did you arrive at seeing this agreement?

  • Error when create XMLType object with JDBC connection

    Hello, I try to get an XMLType object with JDBC, but it doesn't work. Can somebody help me?
    My code is :
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@"+"a02w03:1521:PROJET", "scott", "tiger");
    OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("select xmldoc from cv_col");
    ResultSet rset = stmt.executeQuery();
    OracleResultSet orset = (OracleResultSet) rset;
    while(orset.next())
    OPAQUE o = orset.getOPAQUE(1);
    System.out.println(o.getSQLTypeName());
    XMLType poxml = XMLType.createXML(o);
    My database table:
    CREATE TABLE cv_col (
    XMLDoc xmltype
    Execution: The SQL type name "SYS.XMLTYPE" is write and then I obtain the error:
    Exception in thread main
    java.lang.NoSuchMethodError: java.lang.String oracle.jdbc.internal.OracleConnection.getProtocolType()
         at oracle.xdb.XMLType.initConn(XMLType.java:2072)
         at oracle.xdb.XMLType.<init>(XMLType.java:903)
         at oracle.xdb.XMLType.createXML(XMLType.java:493)
         at Prog.main(Prog.java:26)
    Process exited with exit code 1.
    Thank you, very much!

    What platform are you using for the database, what are you running your code on.
    Which database version are you working with.. What is your class path. What version of JDBC and OCI are in the client environment, eg what are CLASSPATH and PATH / LD_LIBRARY_PATH settings. Have you tested your code using a simple IDE like Oracle's JDeveloper or run it from directly from the command line.

  • Opening files with serialized objects even if class definition has changed.

    Dear all,
    We are deploying an application wich saves serialized objects. But when changing something in the code and especially in the serialized classes we are not able to open files which have been saved with the old 'outfit' of the class.
    I think, that this is probably a common problem and therefore I am interested whether there exists also a common or practical solution.
    What is the direction I have to look in? XML, Serializable or is it something else?
    Thanks for a short answer,
    Axel

    If you add, remove or change a classes variables, then it will be serialized differently.
    Any fields which you do not need to be serialized, may be marked as transient, so you can add and remove them at will.
    In the longer term, you can override the readObject() / writeObject() methods and explicitely load/save what fields you want. This will also allow you to set intelligent defaults, if for example, you added a new field, but your old serialised classes do not have this field. You can also precede all serialised data with version numbers... might help a bit.
    So code ( psuedocode ) might look like this...
    private void readObject(java.io.ObjectInputStream in)
         throws IOException, ClassNotFoundException;
        int ver = in.readInt();
         classfield1 = in.readLong();
        if ( ver >= 2 )
            classfield2 = in.readLong();
        if ( ver >= 3 )
             classfield3 = in.readLong();
    }regards,
    Owen

  • Oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray

    Hi,
    I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
    I am using weblogic 11g.
    27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
    at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
    at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
    at org.hibernate.loader.Loader.getRow(Loader.java:1230)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
    at org.hibernate.loader.Loader.doQuery(Loader.java:724)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2232)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
    at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
    at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
    at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Regards,
    Abhishek

    Creating my Oracle connection works fine ... code as follows:
    <i>Context ctxt = getInitialContext();
    DataSource dataSource = (DataSource) ctxt.lookup(poolName);
    Connection conn = dataSource.getConnection();
    OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
    I also have reviewed documentation:
    http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
    <i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
    None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT.

  • Problem with serialized objects and JWS

    My JWS launched application fails when loading a serialized object that has been instatiated from a class not contained in the signed jar-file. Does anyone know why this happens and if there is some workaround for the problem?

    Where is the class contained then?

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • A General serialized object

    Hi!
    I'm trying to create some server software that will allow any number of applets to connect to the server and communicate with each other. Presumably, only applets of the same type would talk together, though applets could send general string messages. I've created a general serialized object, Packet, which all applets would send to the server, and which the server would then pass on to the destination applet(s).
    The problem is that Packet has a field "data" of type Object. When data is something the server knows about, such as a String or a Vector, it does ok. But if the code for the applets creates a new class, say AppletPacket (which is serializable), and sets somePacket.data to an object of type AppletPacket, the server throws errors when it is reading the somePacket from its objectinputstream, saying it can't typecast something of type AppletPacket. But I'm not typecasting anywhere! The server doesn't have to know anything about what data represents, it just needs to send it on, and presumably the destination applets will know what to do with it.
    Can anyone suggest a work around, or tell me what I have to do so that applets can send a general Object that may represent a class the server doesn't know about and not have the server throw an error?
    Thanx
    Jim D.

    Just to clairify: The server doesn't have to do anything with the content of "data" apart from holding on to it, and pass it to another applet?
    If that's the case substitute the Object in the "data" field for an array of bytes obtained by having the applet run the "Object" through ObjectOutputStream.
    What's happening is that the server is deserializing the Packet when it arrives in the JVM of the server, when it comes across the "data" field it looks to see what class the instance really is, and fails as you dscribe if it doesn't have the class definition.

  • Size of serialized Objects

    Hello everybody,
    When I serialize a object to a Byte Array the size of the Byte Array is not exactly the size of the object because of some meta data information. Is there any way there I can predict excatly the size that the Object will have when I serialize it? Of course I known the attributes size of this Object.
    For example if I have an Object X with two attributes Integer A and B with 4 bytes each, I'd like to predict that the Byte Array of this serialized Object wil have 10 bytes (8 for the two attributes and 2 for meta data). Does anybody have an idea?
    Thanks,
    Bruno

    Is
    there any way there I can predict excatly the size
    that the Object will have when I serialize it?Yes. You can serialize it to a byte array, then take the size of that. Then you can send the byte array instead of serializing the original object.
    Basically this is something that's very unlikely to be useful. What are you trying to achieve and why do you think you need to know this information?
    Dave.

Maybe you are looking for

  • Questions on FP1, FP2, Belle Refresh and availabil...

    Hello, First things first: Note that my post is not intended to ask when Belle Refresh will be available for my phone. I have been reading a lot about this topic, on this and many other forums, and know by now that I need to be patient and wait for B

  • Problem with Contacts Q5

    Hello everybody, I am new in this forum and I want to say hi to everybody. I just received the new Q5 that my company gave me replacing my old 9320. They did all the telephone setup and "normally" I should find everything I had in the old phone. And

  • Safari and Firefox problems with wireless network

    I have seen similar questions to mine on the forums recently. Here's my story: I have 5 month old Mac Book with Leopard, no airport extreme, just the inbuilt Airport card. I connec through the internet with Netgear. I have been on to Apple support wh

  • Memory full error when trying to access 'access po...

    Hi *, I am using the wlan feature of my lovely e70 quite a lot. Therefore I have quite a lot off access points defined. Now I try to go to the 'access points' and I get a memory full error. About a month ago I updated to 3.0633.09.04 (german). With 2

  • CS6 Issues Mountain Lion

    I am running the latest version of Photoshop CS6 on my mid-2010 13 inch Macbook Pro with 8gb of memory. Mountain Lion is the OS. Whenever I launch CS6 it crashes with the following message: An unexpected and unrecoverable problem has occurred. Bridge