KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rmijdbc > RJRefServer


1
2 /**
3  * RmiJdbc client/server JDBC Driver
4  * (C) ExperLog 1999-2000
5  *
6  * @version 1.0
7  * @author Pierre-Yves Gibello (pierreyves.gibello@experlog.com)
8  * Additional SSL Support
9  * Douglas Hammond(djhammond@sympatico.ca)
10  */

11
12 package org.objectweb.rmijdbc;
13
14 import java.sql.*;
15 import java.rmi.RemoteException JavaDoc;
16 import java.rmi.server.UnicastRemoteObject JavaDoc;
17 import java.rmi.server.Unreferenced JavaDoc;
18
19 /**
20  * A reference to an SQL structured type value in the database.
21  * A Ref can be saved to persistent storage. A Ref is dereferenced by
22  * passing it as a parameter to an SQL statement and executing the statement.
23  */

24
25 public class RJRefServer
26 extends UnicastRemoteObject JavaDoc
27 implements RJRefInterface, Unreferenced JavaDoc {
28
29   java.sql.Ref JavaDoc jdbcRef_;
30
31   public RJRefServer(java.sql.Ref JavaDoc r) throws RemoteException JavaDoc {
32        super(RJJdbcServer.rmiJdbcListenerPort, RJJdbcServer.rmiClientSocketFactory, RJJdbcServer.rmiServerSocketFactory);
33     jdbcRef_ = r;
34   }
35
36   public void unreferenced() { Runtime.getRuntime().gc(); }
37
38   public String JavaDoc getBaseTypeName() throws RemoteException JavaDoc, SQLException {
39     return jdbcRef_.getBaseTypeName();
40   }
41
42   // -----------------------JDBC 3.0 ------------------------
43
public Object JavaDoc getObject(java.util.Map JavaDoc map) throws RemoteException JavaDoc, SQLException {
44     return jdbcRef_.getObject(map);
45   }
46   
47   public Object JavaDoc getObject() throws RemoteException JavaDoc, SQLException {
48     return jdbcRef_.getObject();
49   }
50
51   public void setObject(Object JavaDoc value) throws RemoteException JavaDoc, SQLException {
52     jdbcRef_. setObject(value);
53   }
54 };
55
56
Popular Tags