KickJava   Java API By Example, From Geeks To Geeks.

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


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  */

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

20
21 public class RJRef implements java.sql.Ref JavaDoc, java.io.Serializable JavaDoc
22 {
23
24   RJRefInterface rmiRef_;
25
26   public RJRef(RJRefInterface r) {
27     rmiRef_ = r;
28   }
29
30   public String JavaDoc getBaseTypeName() throws SQLException {
31     try {
32       return rmiRef_.getBaseTypeName();
33     } catch(RemoteException JavaDoc e) {
34       throw new java.sql.SQLException JavaDoc(e.getMessage());
35     }
36   }
37
38     // -----------------------JDBC 3.0 ------------------------
39
public Object JavaDoc getObject(java.util.Map JavaDoc map) throws SQLException {
40     try {
41       return rmiRef_.getObject(map);
42     } catch(RemoteException JavaDoc e) {
43       throw new java.sql.SQLException JavaDoc(e.getMessage());
44     }
45   }
46
47   public Object JavaDoc getObject() throws SQLException {
48     try {
49       return rmiRef_.getObject();
50     } catch(RemoteException JavaDoc e) {
51       throw new java.sql.SQLException JavaDoc(e.getMessage());
52     }
53   }
54   
55   public void setObject(Object JavaDoc value) throws SQLException {
56     try {
57       rmiRef_.setObject(value);
58     } catch(RemoteException JavaDoc e) {
59       throw new java.sql.SQLException JavaDoc(e.getMessage());
60     }
61   }
62
63 };
64
65
Popular Tags