01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Core License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: DbClient.java,v 1.2 2002/06/25 11:34:38 mediumnet Exp $
08:
09: package org.ozoneDB.core.DbRemote;
10:
11: import java.io.IOException;
12: import org.ozoneDB.DxLib.*;
13: import org.ozoneDB.DxLib.net.DxClient;
14: import org.ozoneDB.*;
15: import org.ozoneDB.core.*;
16: import org.ozoneDB.util.*;
17:
18: /**
19: * @author <a href="http://www.softwarebuero.de/">SMB</a>
20: * @version $Revision: 1.2 $Date: 2002/06/25 11:34:38 $
21: */
22: public abstract class DbClient extends DxClient {
23:
24: protected ExternalDatabase db;
25:
26: protected String user = "";
27:
28: public DbClient(ExternalDatabase _db, String _user)
29: throws IOException {
30: db = _db;
31: user = _user;
32: }
33:
34: public DbClient(ExternalDatabase _db, String _host, int _port,
35: String _user) throws IOException {
36: super (_host, _port);
37: db = _db;
38: user = _user;
39: }
40:
41: public String user() {
42: return user;
43: }
44:
45: public Object receive() throws IOException, ClassNotFoundException {
46: Object result = super .receive();
47:
48: if (Env.selfCheck) {
49: if (result == null) {
50: /*
51: System.err.print("DbClient.receive(): result="+result+", here = ");
52: new Exception().printStackTrace(System.err);
53: */
54: }
55: }
56:
57: return result;
58: }
59: }
|