|
Mimer JDBC Engine 2.12 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.mimer.jdbc.MimerDataSource
MimerDataSource implements the javax.sql.DataSource interface and may serve several purposes.
In an enterprise environment, objects of this class may be configured and stored in a JNDI pool for later retrieval. This feature is only supported by the Mimer JDBC Engine driver (mimjdbc). For examples on how to configure and store MimerDataSource objects in a JNDI pool, see the Mimer JDBC Guide.
The J2ME-drivers (minjdbc and midjdbc) supplies a MimerDataSource class as the preferred method of making a connection. These drivers does not support being stored in a JNDI pool.
The MimerDataSource class supports Javabeans. This means this class may be configured using generic IDE tools.
Before a connection is attempted by calling
MimerDataSource.getConnection the database name attribute must be set. This specifies database on the host
to connect to. Use setDatabaseName(java.lang.String) to set this attribute.
| Constructor Summary | |
MimerDataSource()
|
|
| Method Summary | |
Connection |
getConnection()
Attempts the connection to the host with the specified database, user and password. |
Connection |
getConnection(String user,
String password)
Attempts the connection to the host with the specified user and password. |
String |
getDatabaseName()
Returns the database name associated with the DataSource object. |
String |
getDescription()
Returns the description of the database. |
int |
getLoginTimeout()
Returns the current login timeout of the DataSource object. 0 implies no timeout. |
PrintWriter |
getLogWriter()
|
String |
getPassword()
Returns the password associated with thie DataSource object. |
int |
getPortNumber()
Gets the port number associated with the DataSource object. |
Reference |
getReference()
|
String |
getServerName()
Returns the host name of the DataSource object. |
String |
getUser()
Returns the user name associated with the DataSource object. |
void |
setDatabaseName(String databaseName)
Sets the database name to connect to. |
void |
setDescription(String description)
A plausible description of the database. |
void |
setLoginTimeout(int timeout)
Sets the login timeout in seconds. |
void |
setLogWriter(PrintWriter out)
|
void |
setPassword(String passWord)
Sets the password of the database user to connect as. |
void |
setPortNumber(int portNumber)
Sets the IP port number to use when connecting to the Mimer SQL Server. |
void |
setServerName(String serverName)
The host machine of the server to connect to. |
void |
setUser(String userName)
The database user to connect as. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MimerDataSource()
| Method Detail |
public Connection getConnection()
throws SQLException
Before calling this method, the following attributes should be set.
setUser(java.lang.String) to set this attribute.setPassword(java.lang.String) to set this attribute.
getConnection in interface DataSourceSQLException - if an error occurs. SQLSTATE 08004 is thrown if the connection failed because of a wrong user or password, or if an attempt was made to connect to a Mimer SQL server older than 8.2. 08001 is thrown if the connection failed because the server could not be contacted, perhaps it was down.
public Connection getConnection(String user,
String password)
throws SQLException
Before calling this method, the following attributes should be set.
getConnection in interface DataSourceSQLException - if an error occurs. SQLSTATE 08004 is thrown if the connection failed because of a wrong user or password, or if an attempt was made to connect to a Mimer SQL server older than 8.2. 08001 is thrown if the connection failed because the server could not be contacted, perhaps it was down.public String getDatabaseName()
setDatabaseName(java.lang.String)public String getDescription()
setDescription(java.lang.String)public int getLoginTimeout()
getLoginTimeout in interface DataSourcesetLoginTimeout(int)public PrintWriter getLogWriter()
getLogWriter in interface DataSourcepublic String getPassword()
getPassword()public int getPortNumber()
setPortNumber(int)
public Reference getReference()
throws NamingException
getReference in interface ReferenceableNamingExceptionpublic String getServerName()
setServerName(java.lang.String)public String getUser()
setUser(java.lang.String)public void setDatabaseName(String databaseName)
databaseName - The name of the database to connect to.getDatabaseName()public void setDescription(String description)
description - A description of the database.getDescription()
public void setLoginTimeout(int timeout)
throws SQLException
setLoginTimeout in interface DataSourcetimeout - The requested timeout in seconds. Use 0 to disable
connection timeout.
SQLExceptiongetLoginTimeout()public void setLogWriter(PrintWriter out)
setLogWriter in interface DataSourcepublic void setPassword(String passWord)
passWord - The password.getPassword()public void setPortNumber(int portNumber)
portNumber - The IP port to use. The default is 1360.getPortNumber()public void setServerName(String serverName)
serverName - The host to connect to.getServerName()public void setUser(String userName)
userName - The user name, at most 128 characters.getUser()
|
Mimer JDBC Engine 2.12 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||