KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > DbRemote > DbClient


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: DbClient.java,v 1.4 2002/09/18 06:54:15 per_nyfelt Exp $
8

9 package org.ozoneDB.core.DbRemote;
10
11 import org.ozoneDB.DxLib.net.DxClient;
12 import org.ozoneDB.ExternalDatabase;
13 import org.ozoneDB.core.Env;
14
15 import java.io.IOException JavaDoc;
16
17
18 /**
19  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
20  * @version $Revision: 1.4 $Date: 2002/09/18 06:54:15 $
21  */

22 public abstract class DbClient extends DxClient {
23     
24     protected ExternalDatabase db;
25     
26     protected String JavaDoc user = "";
27     
28     
29     public DbClient(ExternalDatabase _db,String JavaDoc _user) /*throws IOException*/ {
30         db = _db;
31         user = _user;
32     }
33     
34     
35     public DbClient( ExternalDatabase _db, String JavaDoc _host, int _port, String JavaDoc _user ) throws IOException JavaDoc {
36         super( _host, _port );
37         db = _db;
38         user = _user;
39     }
40     
41     
42     public String JavaDoc user() {
43         return user;
44     }
45
46     public Object JavaDoc receive() throws IOException JavaDoc, ClassNotFoundException JavaDoc {
47         Object JavaDoc result = super.receive();
48
49         if (Env.selfCheck) {
50             if (result==null) {
51                 /*
52                 System.err.print("DbClient.receive(): result="+result+", here = ");
53                 new Exception().printStackTrace(System.err);
54                 */

55             }
56         }
57
58         return result;
59     }
60 }
61
Popular Tags