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

Similar Messages

  • 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 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.

  • How to load a java script in oracle database

    Is it possible to load d java script in Oracle database. while the object type is
    java resource ..

    RENUJP wrote:
    I meant to load a javascript to oracle database not to oracle appliocation.
    like loadjava....
    I can load a javascript to oracle database.. but i can't call it...Please re-read the comments above, especially the part about this not being a javascript nor oracle forum. Exactly what part about this information don't you understand?

  • Dropping java object from Oracle 8i

    We areaable to load java methods and publish them to SQL in Oracle 8i using Jdev Deploy wizard, but we can not drop them thru
    Open View As->Database Browser of the connection object, they drop menu is greyed out/disable. What kind privilege we need to drop java object from Oracle 8i? Or there is something wrong with the database setup.
    Thank you very much

    There are three options:
    Normal
    SysDBA
    SysOper
    I have tried the three of them, none of them works, is there third option SYS?
    Thank you very much.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Amit:
    Log in as SYS.<HR></BLOCKQUOTE>
    null

  • Store PDF File in Oracle database 10g

    Hi all,
    I want to store PDF File in Oracle database 10g,
    and then I want to access the pdf file using Oracle Developer 6i
    can anyone tell me how to do this,
    thanks in advance.

    This question has already been posted a lot of times.....
    See the following:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=pdf+file&objID=f82&dateRange=lastyear&userID=&numResults=15
    Greetings,
    Sim

  • I want store JMS queue in oracle database..

    Hi all,
    I want store JMS queue in oracle database..
    How can i configure my jboss 3.0.1
    Thanks,
    Thilsen

    Oracle provides this functionality with Advanced Queues
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96587/qintro.htm
    Although the API is JMS-compliant, the administration can be quite burdensome.

  • Store java Object in database

    Hi,
    firstly, excuse me for my english but i'm french.
    I need to store a java object. Is it possible to store a java object like a JPanel, an InetAdress, an URL, or an object of my conception in a database ?
    Anbd how should the table be declared ?

    Well first you need to learn how to use JDBC.
    With that knowledge available, you have two basic options:
    1) for each bean, write code to turn it into an insert statement / update statement / delete statement (easy, but lots of work)
    2) use the Java reflection API to automate the sql generation.
    A third option would be to use google and search for an API that can do this for you.

  • How to store image in the oracle database 10.2.

    Hi.,
    I am working on 10g ids. I have designed a form where there are two fields. Name and picture.
    I want to keep details of the person with their photo.
    I can simply put name but how to insert image in the picture field??
    can you suggest ??
    Thanks.
    Shyam

    Hi
    To store your binary images in an Oracle database, you will need to create a column in your table defined with the BLOB datatype BLOB stands for Binary Large Object. Images from scanners, mpeg files, movie files and so on can all be stored in the BLOB column
    sq>CREATE TABLE test_table (
       id NUMBER,
       image BLOB);then go to
    [http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10796/toc.htm]

  • Store an Object in Oracle?

    Anyone can tell me how to store an java Object data in Oracle table? Thanks, joy

    Have the password visible??? Why??? All you have to do is to capture the password that the user typed in and pass it as a variable to the connection string.
    Say, if you are using the JDBC:ODBC bridge, it will be something like this:
    Connection con = DriverManager.getConnection(
    url, login, password);
    //where url, login, and password are all variables.
    Hope this helps.

  • How to insert a java object int derby database

    hi,
    i have a problem , ie..i want to insert my java object int database derby.and also i need to retrieve that object from database whenever i need. Any body help me to do that in derby...
    Thanks

    Or you would design a table where the columns of the table correspond to attributes of the object. Then you would make a row by writing out the attributes to the columns they correspond to.

  • Store SQL Query in Oracle database

    Hello,
    I am storing SQL query in database. here is an example of query.
    INSERT INTO TABLE_1 Values (' " + getValue1() + " ', ' " + getValue2() + " ' )
    getValue1() and getValue2() are functions to retrieve values.
    When I read query from the database and execute it, it doesn't read values from function.
    After I read query from database I would expect it to be
    INSERT INTO TABLE_1 Values ('value1', ' value2' ) but it is not reading values and trying to execute whatever I got from database.
    Any help?
    Thanks

    Thanks for your reply. Let me give you more info.
    All I am trying to do is storing queries in oracle
    database to use it in future for reporting. As I am
    doing reporting where clause will be different every
    time. Reporting involves queries not updates. But in any case that means that you would use a java SQL string that is useable via a prepared statement. As such your statement would look like....
    INSERT INTO TABLE_1 Values (?,?)
    Is it not possible to substitute variable string I
    got from database?What do you mean?
    SQL is SQL. You construct SQL so it is valid and runs. Can you construct SQL so it runs a function/select and uses that value in some more SQL - depends on the database, but usually.
    But that has nothing to do with java - it is SQL.
    Query contains variables that I have in Java code .Then it is SQL. It is java. You use bind variables (see PreparedStatement) and assign values to it.
    The SQL for such a query would look like the following...
    select field1, field2 from table1 where id=?
    In your java you would then use something like PreparedStatement.setInt(1, 100), to fill in the value for the '?' in the above.
    You might also note that your solution will not work for any arbritrary SQL statement unless you are also storing meta data about the SQL itself. For instance the following SQL statements would return the same result set but your java code would have to populate the bind variables different for both...
    select field1, field2 from table1 where id=? and name=?
    select field1, field2 from table1 where name=? and id=?

  • How to store image in the oracle database 10.2. using File Maker 10.

    Hi.,
    I want to store image, media file in the oracle database using File Maker as a front end.
    I connect Oracle using odbc from file maker. There are table and in that table there a column "pict" of blob type. but this column is not showing in the file maker.
    2. Here I can not change the data type of any column.
    Now how to store images in the oracle table using odbc or any other tool.
    Regards,
    Shyam

    I wrote an example for my students, you can find it here. It's using PHP as the front end but all you need to do is know how and leverage the stored procedures. All code is downloadable in zip files from the blog.
    http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

  • Connecting Java application to Oracle Database with JDBC

    How can I connect my Java application using Oracle 11g database?
    Please provide the steps involved along with the coding.

    What kind of Java application? Stand alone/desktop? Or web? Do you need dedicated, individual connections, or connection pooling for 10,000 concurrent users?
    You'll find a few clues in This Article [This Article|http://javawebdb.com/2012/01/30/connecting-a-java-servlet-to-a-database/]

  • Java Objects for Oracle datatypeJava Objects for Oracle user-defined datatype

    I'm trying to create a Java object that maps to VARRAY of numbers.
    I created a type "NUMARRAY" which is a varray of numbers.
    I also created a type "NUMCOLLECTION" which is an object and contains "NUMARRAY"
    The plan was to create the java object to map to numcollection. My question is can I map a java type directly to the NUMARRAY type, or must it map to an object? (here I'm referring to 'CREATE TYPE NUMARRAY AS VARRAY" or "CREATE TYPE NUMCOLLECTION AS OBJECT" in sql.
    Also, if I do need to write java objects for both types? And if I do, do both need to implement SQLData?
    I'm trying to create a Java object that maps to VARRAY of numbers.
    I created a type "NUMARRAY" which is a varray of numbers.
    I also created a type "NUMCOLLECTION" which is an object and contains "NUMARRAY"
    The plan was to create the java object to map to numcollection. My question is can I map a java type directly to the NUMARRAY type, or must it map to an object? (here I'm referring to 'CREATE TYPE NUMARRAY AS VARRAY" or "CREATE TYPE NUMCOLLECTION AS OBJECT" in sql.
    Also, if I do need to write java objects for both types? And if I do, do both need to implement SQLData?
    Does anyone have an example? Your expertise would be much appreciated.
    Thanks,
    Roxanne
    null

    Hi Roxanne,
    I have the same problem if you get an idea or answer..I have a problem in updating and inserting in Varray datatype from java object of Objects (arraylist)..
    please mail me
    [email protected]
    Bye
    I created a type "NUMARRAY" which is a varray of numbers.
    I also created a type "NUMCOLLECTION" which is an object and contains "NUMARRAY"
    The plan was to create the java object to map to numcollection. My question is can I map a java type directly to the NUMARRAY type, or must it map to an object? (here I'm referring to 'CREATE TYPE NUMARRAY AS VARRAY" or "CREATE TYPE NUMCOLLECTION AS OBJECT" in sql.
    Also, if I do need to write java objects for both types? And if I do, do both need to implement SQLData?
    I'm trying to create a Java object that maps to VARRAY of numbers.
    I created a type "NUMARRAY" which is a varray of numbers.
    I also created a type "NUMCOLLECTION" which is an object and contains "NUMARRAY"
    The plan was to create the java object to map to numcollection. My question is can I map a java type directly to the NUMARRAY type, or must it map to an object? (here I'm referring to 'CREATE TYPE NUMARRAY AS VARRAY" or "CREATE TYPE NUMCOLLECTION AS OBJECT" in sql.
    Also, if I do need to write java objects for both types? And if I do, do both need to implement SQLData?
    Does anyone have an example? Your expertise would be much appreciated.
    Thanks,
    Roxanne
    null

Maybe you are looking for