How to store Java ArrayList or any Collection object

Hi,
How Can I store Java ArrayList or any Collection object into Oracle tables.
In that case what should be the Oracle datatype of that column.
Can anybody tell me in details...
Thanks in advance.
Ashok R

Ashok,
Search this forum's archives for ARRAY and STRUCT.
Good Luck,
Avi.

Similar Messages

  • How to pass java arraylist into javascript arrays

    Hi, i have declare an arraylist
    ArrayList list1 = new ArrayList();Inside the arraylist, there are elements. Now, i wan to pass the elements in the java arraylist into javascript arrays but i encounter javascript errors.
    This is how i code.
    var arr1 = new Array();
    <%
    for ( int x =0; x<list1.size(); x++)
    %>
         arr1[<%=x%>] = <%=(String)list1.get(x)%>;
    <%
    %>how do i solve this problem?
    Thanks for the guidance in advance

    JTech wrote:
    Hi,
    Use Quotes around string value ( arr1[indexposition] = "stringvalue";), when assign to javascript array as below.
    arr1[<%=x%>] = "<%=(String)list1.get(x)%>"; Regards,
    Ram.Hi Ram,
    How about using arr1 = <%=list.toArray()%> ??? Is this possible? I tried it but was not working on my IDE. Do you have any solutions for this??
    Regards,
    Thiagu

  • How to store the member data of an object?

    hi,
        how do i store the data member of an object in labview? I want the data to be available from a different vi as well. i'll cretae an object and would set some attributes to it. So when i call this object by its name from a different vi, i want the attributes that was set to the object to be displayed. how do i achieve this.
    Regards
    Jayaraman

    If the only thing you need is a container to store values, then, as I mentionned in your other post:
    Do a search on "Action Engine" within this forum.  A sub-section of Action Engines is something called a "Functional Global Variable".
    You can also do a search on that.  Functional Global Variables are VERY different from Globals or Shared Variables.  They are often used as a container to store values and allow to share among VI's.  It only retains the last value written to it (unless you modify the structure but I won't get into that). 
    Here is an example of what an AE looks like: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_descending&message.id=311549#M311549
    Another Action Engine example: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_descending&message.id=289773#M289773
    Nugget on Action Engine: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=240328
    Simple explanation of Functional Globals: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_descending&message.id=56747#M56747

  • How to store the Arraylist value in variables ?

    Hi
    Here i use arraylist and i like to store all the arraylist in different variables Please tell the way .
    ArrayList list = new ArrayList();
    list.add("A");
    list.add("B");
    list.add("C");
    list.add("D");
    String a=""
    String b="";
    String c=""
    String d="";How to get and store the array list into the string variables
    Thanks & Regards
    Merlina
    Message was edited by:
    MerlinRosina

    Hai
    Thanks to your reply
    I already try this way but it throw the error "incompatible types"
    Do know any other way to store the object of arraylist into variables

  • How to store java objects in the database

    Hi,
    I am trying to store HttpSession state across Application Servers. Basically I am trying to build a sort of application cluster server on my own. I thought the best way to do this was to periodically store the HttpSession object from an application server in a database.
    I created a table in Oracle 8i with a blob column. I use a PreparedStatement.setObject() method to store the HttpSession object in the database. My problem is, I don't know how to get the object back from the database.
    Since ResultSet.getBlob returns the Blob locator, I need to read the BinaryInputStream to get all my data back. This tells me that getBlob basically works only for things like files, and cannot be used for Java objects.
    Is there any way around this? Your input would be much appreciated.
    Regards,
    Somaiah.

    Thanks for the quick reply vramakanth.
    Do I have to use a type map if I do this? Also does such a type map exist for the HttpSession class?
    Thanks,
    Somaiah.

  • Custom component  - how to store java Properties object in ucm environment

    Hi Experts,
    I am developing a custom component.
    my custom component code is reading a properties file and load in Properties object. Everytime this custom Service is called, properties file is read from file system and new Properties Object is created.
    Is there any way to load the Properties object once and store somewhere in UCM context ? (just like we do in JSP using application object"
    thanks!!
    Edited by: user4884609 on Jul 12, 2010 3:01 PM

    I'd say there are quite a few ways how to do it, but many of them have nothing in common with UCM.
    - I'd opt for the only "UCM" way I' aware of: as a part of custom component you can create your own properties file (it's also called environment variables) as a part of your custom component. You can, then, easily read (and write?) properties from/to the file.
    - The first option could have disadvantage, if there are too many properties. In this case you could use Java serialization - it should be UCM independent
    - Another option is to create your properties in the database - it is a bit similar to the first option, but it's more robust. Plus, you may use features of the database if you want to have some additional logic in you properties.
    - Note that you can also create a static object, which could be initialized e.g during class load

  • How to access java arraylist from xslt v1?

    Hi everybody,
    I have a problem using xsl trasformation and an object that contains nested arraylistes.
    the object is structured in this way
    Request
    |---id
    |---event
    |---ListOfComponent
    |------*<List>component*
    |---------idComponent
    |---------description
    |---------*<List>properties*
    |-------------name
    |-------------value
    I'm able to get the values of id and event in this way: Request.id and Request.event;
    I'm not able to get the values of the idComponent and the name values of the list subobjects: Request.ListOfComponent.component[0].idComponent;
    When I execute the application that call the xsl trasformation i get an exeption not a vector or an array.
    So, I would like to know if is possible and if yes how can I do!
    thanks!
    Edited by: EttoreMI on 10-nov-2011 7.21
    Edited by: EttoreMI on 10-nov-2011 7.21

    Since I'm using an HP product right now I can only the exeption without stack
    Unexpected exception: java.lang.Exception: Cannot create a new transformer instance: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Illegal value: objInput.listOfComponent.component[0].idAppuntamento used for QNAME attribute: name
    localhost.localdomain     Nov 10, 2011 9:54:12 AM     TransformXML     Running Errorhandler ID #682. Workflow: 'inserisciAppuntamento', Step: 'TransformXML', com.hp.ov.activator.mwfm.component.WFException: Cannot create a new transformer instance: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Illegal value: objInput.listOfComponent.component[0].idAppuntamento used for QNAME attribute: name
    here the xsl trasformation that I wrote
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:param name="JOB_ID" />
    <xsl:param name="objInput"/>
    <xsl:param name="objInput.requestId"/>
    <xsl:param name="objInput.idOdl"/>
    <xsl:param name="objInput.evento"/>
    <xsl:param name="objInput.azione"/>
    <xsl:param name="objInput.listOfComponent.component[0].idAppuntamento"/>
    <xsl:template match="/">
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:px="http://px_request.hp.com/">
    <soapenv:Header>
         <JOB_ID><xsl:value-of select="$JOB_ID"/></JOB_ID>
    </soapenv:Header>
    <soapenv:Body>
    <px:Request>
    <requestId><xsl:value-of select="$objInput.requestId"/></requestId>
    <idOdl><xsl:value-of select="$objInput.idOdl"/></idOdl>
    <evento><xsl:value-of select="$objInput.evento"/></evento>
    <azione><xsl:value-of select="$objInput.azione"/></azione>
    <listOfComponent>
    <component type="Appuntamento">
    <pratica><xsl:value-of select="$objInput.listOfComponent.component[0].pratica"/></pratica>
    <idAppuntamento><xsl:value-of select="$objInput.listOfComponent.component[0].idAppuntamento"/></idAppuntamento>
              <property>
    </property>
    <component/>
    </component>
    </listOfComponent>
    </px:Request>
    </soapenv:Body>
    </soapenv:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    I hope it is helpful in order to understand

  • How to store java object in oracle

    Hi all,
    is it possible to store jva object in oracle.
    I have defined myClass. It have only data fields ( no methods).
    I make myClass myObject = new myClass();
    How can I store this object in oracle DB.
    Many thanks in advance.

    1.Convert this object into stream of Bytes.
    2.create a new InputStream from these Byte array.
    2.Use the setBinaryStream to set the values inside the table's column.
    3.Store this object as a Blob in the table (column type must be Blob).
    Hope this helps.
    Sudha
    PS:- Somebody explained in this forum how to convert an Object into Byte array .

  • How to Store java.util.Map object using JPA

    Hi
    I have a cache where the underlying object is just a map (HashMap for example).
    I'd like to create a JPA backing store for this cache.
    Is there a way to do that, or can JPA only store objects that are JPA annotated?
    Thanks
    Edited by: mesocyclone on Dec 11, 2008 4:22 PM

    Hi,
    I believe that the objects that the Map contains would need to be JPA annotated.
    --Tom                                                                                                                                                                                               

  • How to store multiple data's in an object

    i am preparing a game, the game has four bet spots. i want to save the user bet details. i like to save the user bet details in an object, so i can access it whenever i need.
    I have done same thing in AS 2.0. my object will look like
    player[0].betSpot1.amount="100"
    player[0].betSpot2.amount="200"
    i am not sure to do this in AS 3.0. any help pls
    Thanks in advance

    What you show has errors even for AS2.  The most significant one being that your buttons are not being named to give you what your code is after.  Tr the following and rename your buttons to fit the intentions of the code...
    var gameDetails:Object = new Object();
    gameDetails.player = new Array(new Object());
    betSpot_0.mouseChildren = true;
    betSpot_0.addEventListener(MouseEvent.CLICK, onBtnClick);
    function onBtnClick(e:MouseEvent){
        var btn = e.currentTarget.name;
        var spot = String(btn).split("_")[0];
        var spotId =String(btn).split("_")[1];
        gameDetails.player[spotId].betSpot = spot;
        gameDetails.player[spotId].betSpotId = spotId;
    edit:  after rethinking what I offered, I believe it is also off the mark, but I also think there is likely a much simpler data structure you can use for whatever purpose this data is going to serve.  If you can explain what the data needs to provide, it might be possible to help you define a simpler structure.  A bit of what you showed originally, an array of objects, would seem much more suitable.

  • How to store entered quantity in a new object property in Agentry

    Hi,
    The scenario is that I want to store the quantity entered while receiving MatStocks.
    User can enter quantity to receive stocks (Shown with red outline in Screenshot below)
    I want to store this quantity in a new field Called ReceiveQuantity for each material document.
    Please guide me on this.
    Regards
    Pritam

    Prit,
    This is just basic Agentry.  You should go over some of the introduction documentation to understand these concepts:
    http://scn.sap.com/docs/DOC-47882
    Add a property to your object to hold the new data.  Add the same property to the transaction and tie it to the object property.  On the screen, tie the editable screen field to the transaction property.
    Jason Latko - Senior Product Developer at SAP

  • Ho to store java objects in oracle database

    HI
    for me the sceanario is,
    i neeed to create , dynamically a table at the time of specified action.
    i need to store the values retreieved from session and store it in a database..
    for example
    User usr=session.getAttribute("usr"); i need to store the user object.
    and hashtable and hashmap values without iterating.
    please suggest at the earliest
    can it be done?
    Regards,
    Ramesh

    my requirement is like that,bcos of two different weblogic servers need to acess the central database.which contains user information.
    The user object from first server will be stored in database.and the second server will retrieve the user information and it will set for its application.
    please suggest me how to store java objects in database.
    regards,
    Ramesh

  • Collection object which allows duplicate keys

    I wanted to know if there is any Collection object which allows me to store multiple values for a key.
    I have the data:
    key "a" - value "0"
    key "a" - value "1"
    key "a" - value "2"
    key "b" - value "3"
    key "b" - value "4"
    key "c" - value "5"
    Is there some collection object where I can store the above data which includes duplication of keys?

    No. The values do not need to be stored twice. What I wanted to know
    was if a key [say a in this case] can be repeated so as to store multiple
    values [0, 1, 2] against it?Well, the solution is simple then: use a Set (no matter which one)
    as the value part and collect all the (duplicate?) values in that set.
    Something like this will do:public class Multi {
       private Map map= new HashMap();
       public void put(Object key, Object value) {
          Set values= (Set)map.get(key);
          if (values == null)
             map.put(key, values= new HashSet());
          values.put(value);
       public Set get(Object key) {
          return map.get(key);
    }this was from the top of my head, typed in in a silly little reply box,
    so no warranties apply etc. ;-)
    kind regards,
    Jos

  • How to pass a Java arraylist as a parameter to a StoredProcedureCall

    I need to invoke a stored procedurecall which takes in a collection parameter represented as a nested table. I need to pass a java ArrayList object to it. How can I pass this parameter to the stored procedure using StoredProcedureCall class.

    Hello,
    Check out
    Is possible to pass array/list as parameter in TopLink StoredProcedureCall?
    for some more information on using VARRAYs in 10.1.3. TopLink 11 has a feature that converts VARRAYs to/from collection types for you. An example using "myProcedure" that has an inout parameter "names" defined as type "NAMELIST_TYPE" would be:
        StoredProcedureCall sqlcall = new StoredProcedureCall();
        sqlcall.setProcedureName("myProcedure");
        sqlcall.addUnamedInOutputArgument("names", "names", Types.ARRAY, "NAMELIST_TYPE", ArrayList.class);
        DataReadQuery query = new DataReadQuery();
        query.addArgument("names");
        query.setCall(sqlcall);
        Vector args = new Vector();
        ArrayList names = new ArrayList();
        names.add("firstname1");
        names.add("firstname2");
        args.add(names);
        //DataReadQuery returns a collection of DatabaseRecords
        results = (Vector)getSession().executeQuery(query, args);
        //getting one record from the list:
        names =((ArrayList)((DatabaseRecord)results.get(0)).get("names"))This is just a simple example. More complex nested types can be done by providing a ObjectRelationalDatabaseField parameter describing the type, but I dont have any examples showing this handy.
    Hope this example helps,
    Chris

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

Maybe you are looking for

  • Issue with challan mapping utility

    Hi, We are upgrading to new ECC 6 version. The challan mapping program PC00_M40_CMAP ,when executed with details of challan no and tan no and payroll area with pyrl period , results in showing correct challan amount with 0 personnel nos mapped. What

  • HT201317 Is it possible to sort pictures in shared photo streams?

    I am starting to use this "shared photo streams", and I think it's nice. But I can't find out how to sort pictures in the shared photo streams... - Is it possible? Thank you. Best regards. ...Gunnar

  • Decimal places display at the time of results recording

    Dear All, Please i faced one problem, At the time of results recoridngi/.e, In my insp. plan i defined Quantitative specification as 70.0 with '1' decimal place in Qunatitative data. but after results recording it displaying one more decimal place ex

  • A 1.5 project that can't open properly in CS3!

    I have a rather large 1.5 project that refuses to open properly in CS3. Changed the drive letters allready and still nothing. Says files are missing and should be found...but its hard as I have the same name on a COUPLE OF FILES so pls any help will

  • MDTB table Rescheduling date different than in MD04

    Hello, I am having a very strange situation here : i am getting different data between MDTB table and MD04 transaction. The following message in MD04 for a Purchase requisition : 30: Plan process according to schedule (24.07.2007/18.07.2007) (U4) ->