Actually, no that's not what it's for.

What it does is "Serialize" a class into the db "automagically". 

There are much better products out there with much better functionality


I personally use Artom Rudoy's persistence layer

The following code is an example of how to use Serialize in the postgres

package postgrestest;

 * Title:        Postgres Tests
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      Ebox Inc
 * @author Dave Cramer
 * @version 1.0

 *  Java sample program

 import java.sql.*;
 import org.postgresql.util.*;

 public class lili implements  Serializable

  public String myString;
  public int myNumber;

  public lili()   throws ClassNotFoundException, FileNotFoundException,
IOException, SQLException

  public boolean equals(lili l)
    return (l.myString.equals(this.myString) && myNumber ==
  private void testmethod(){};
  public void testmethod2x(){};

  public static void main(String args[])
    org.postgresql.Connection conn=null;
    try {
      lili mylili = new lili();
      lili test = null;
      Class.forName("org.postgresql.Driver");         // load database
// connect to the database
      conn =
//", "davec",   "");     // works
      // test of serialisation
      org.postgresql.util.Serialize.create(conn, mylili);     // makes
      org.postgresql.util.Serialize s = new Serialize(conn,mylili);
      int oid  =;
      test = (lili)s.fetch(oid);
      if (mylili.equals(test)){
    } catch(Exception exc){
      System.err.println("Exception caught.\n" + exc);
      try {
        if (conn != null) conn.close();
      } catch (Exception ex){


-----Original Message-----
From: Tony Grant [mailto:[EMAIL PROTECTED]] 
Sent: October 5, 2001 9:34 AM
Cc: jdbc list
Subject: Re: [JDBC] Serialize

On Fri, 2001-10-05 at 14:57, Dave Cramer wrote:
> While fixing the handling of "unknown" data type in the result set I 
> was faced with wading through the Serialize code.
> I am wondering if this is really a required/desireable feature?
> How many people out there are actually using it?
> Do we need/want it?
> My thoughts are:
> 1) There are plenty of persistence layers which do this job much 
> better.
> 2) I don't think this belongs in a driver.
> 3) The code will be simpler.

How do I do a database request via JDBC and save the result set to a
text file on the client computer? Isn't that what serialize is for? If
so I need it in the driver.(and instructions on how to get it to work


Tony Grant

RedHat Linux on Sony Vaio C1XD/S
Macromedia UltraDev with PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to