cds.simbad
Class Simbad
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
cds.simbad.Simbad
- All Implemented Interfaces:
- java.rmi.Remote, java.io.Serializable
- Direct Known Subclasses:
- SimbadQuery
- public class Simbad
- extends java.rmi.server.UnicastRemoteObject
- implements java.io.Serializable
Class implementing the RMI interface SimbadInterface. With its two subclasses
SimbadQuery and SimbadUpdate, it builds the Simbad API.
- Version:
- 1.0 Dec 2002
- Author:
- Sylvaine Jaehn (Stage UTBM)
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
Fields inherited from class java.rmi.server.RemoteServer |
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary |
Simbad(java.lang.String database)
Constructor |
Method Summary |
void |
close()
Fermeture de la connexion a la base de donnees |
static java.lang.String |
databaseName(java.lang.String databaseParamName)
Extracts the database name from the whole path defining the main
.prm database parameters file. |
java.lang.String |
getParameterFile()
Acces a l'URL du fichier de parametres principal |
boolean |
open()
Establishes the connection with the default user |
boolean |
open(java.lang.String user,
java.lang.String pwd)
Establishes a connection with the specified user |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
RMIPrefix
public static final java.lang.String RMIPrefix
- See Also:
- Constant Field Values
p
protected static Parameters p
database
private java.lang.String database
pdb
protected static Parameters pdb
driver
private java.lang.String driver
url
private java.lang.String url
defUser
private java.lang.String defUser
defPwd
private java.lang.String defPwd
con
protected static java.sql.Connection con
sjdbc
protected SimbadJDBC sjdbc
Simbad
public Simbad(java.lang.String database)
throws java.rmi.RemoteException
- Constructor
- Parameters:
database
- main database parameter path or url
- Throws:
java.rmi.RemoteException
- if RMI problem
open
public boolean open()
throws java.rmi.RemoteException
- Establishes the connection with the default user
- Returns:
- true if connection succeeded, false otherwise
- Throws:
java.rmi.RemoteException
- if RMI problem
open
public boolean open(java.lang.String user,
java.lang.String pwd)
throws java.rmi.RemoteException
- Establishes a connection with the specified user
- Parameters:
user
- database usernamepwd
- database password for the username
- Returns:
- true if connection succeeded, false otherwise
- Throws:
java.rmi.RemoteException
- if RMI problem
getParameterFile
public java.lang.String getParameterFile()
throws java.rmi.RemoteException
- Acces a l'URL du fichier de parametres principal
- Returns:
- chaine de caracteres representant l'URL
- Throws:
java.rmi.RemoteException
- if RMI problem
close
public void close()
throws java.rmi.RemoteException
- Fermeture de la connexion a la base de donnees
- Throws:
java.rmi.RemoteException
- if RMI problem
databaseName
public static java.lang.String databaseName(java.lang.String databaseParamName)
- Extracts the database name from the whole path defining the main
.prm database parameters file. In fact, it is the whole file
without the path (file or url) and the extension (.prm)
Ex: http://localhost:2001/simbad4.prm => simbad4
- Parameters:
databaseParamName
- the whole path
- Returns:
- the database name