hi all, any idea on how to store java objects to oracle database and retrieve it??? my req: is that, i have to store java exceptions generated into database and then retrive it to genearte various reports for future analysis. we are using servlets and oracle 9i in Linux
"sreejayan"- Welcome to the JavaRanch! Please adjust your displayed name to meet the JavaRanch Naming Policy. You can change it here. Thanks! and welcome to the JavaRanch! Mark
While I know it is possible to save an object somehow in Oracle. there are also three other solutions you could use. 1. use the methods of Exception to create a string that you save in a field. 2. Using Serialization, serialize the object and save the text in a field. When you reread the field, unmarshal it into the object. 3. Using Jaxb, data binding, you can always save the object as XML and store the XML in the table. Or even have the table structure match the XML so that you can load and unload the data between XML and database quickly and easily. Now of course realize that I don't have actual experience doing the above ways, but they are ways that I thought of as possible ways. Mark
Swati Gupta
Ranch Hand
Joined: May 28, 2002
Posts: 106
posted
0
loadjava command is used to store the java classes to oracle database schema you can see all the options using loadjava -help There is little difference based on the driver you are using thin or oci for thin driver it is loadjava -user username/password@host ort:SID -thin nameofclass.class where -user option will load in the schema of user "username". I hope it helps. [ August 08, 2002: Message edited by: swati gupta ] I don't know why the face with tongue out is displaying there I want to write host port sid with : in between. [ August 08, 2002: Message edited by: swati gupta ]
Swati Gupta
Ranch Hand
Joined: May 28, 2002
Posts: 106
posted
0
Also you can query that your class is loaded in database schema with valid status or not using select object_name,status from user_objects where Object_type ='JAVA CLASS'; For objects to be valid you should use the -resolve option of loadjava. You will have to publish the call specs for methods you want to use.