|
Esri Geoportal Server 1.2.9
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.gpt.framework.sql.DatabaseReference
public final class DatabaseReference
Configuration reference for a database.
The reference usually represents a JNDI based connection. It can also represent a direct connection (driver/url/user/pwd), but this is usually limited to a non-production environment.
| Constructor Summary | |
|---|---|
DatabaseReference()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
closeConnection(Connection con)
Closes a JDBC connection. |
String |
getDirectDriverClassName()
Gets the driver class name for a direct database reference. |
String |
getDirectPassword()
Gets the password for a direct database reference. |
String |
getDirectUrl()
Gets the URL for a direct database reference. |
String |
getDirectUsername()
Gets the username for a direct database reference. |
boolean |
getIsJndiBased()
Gets the JNDI based reference status. |
protected DataSource |
getJndiDataSource()
Gets the JNDI based DataSource for the reference. |
String |
getJndiName()
Gets the name for a JNDI based database reference. |
protected String |
getReferenceLabel()
Gets the label for the database reference. |
String |
getReferenceName()
Gets the name for the database reference. |
StringSet |
getTags()
Gets the tags associated with the reference. |
Connection |
openConnection()
Makes a JDBC connection from based upon the configuration of the database reference. |
protected Connection |
openDirectConnection()
Opens a direct JDBC connection based upon the driver, url, username and password. |
protected Connection |
openJndiConnection()
Opens a JDBC connection from the JNDI DataSource associated with the JNDI name. |
protected DataSource |
openJndiDataSource(String jndiName)
Opens the DataSource associated with the JNDI name. |
void |
setDirectDriverClassName(String driver)
Sets the driver class name for a direct database reference. |
void |
setDirectPassword(String password)
Sets the password for a direct database reference. |
void |
setDirectUrl(String url)
Sets the URL for a direct database reference. |
void |
setDirectUsername(String username)
Sets the username for a direct database reference. |
void |
setIsJndiBased(boolean isJndiBased)
Sets the JNDI based reference status. |
void |
setJndiName(String jndiName)
Sets the name for a JNDI based database reference. |
void |
setReferenceName(String referenceName)
Sets the name for the database reference. |
protected void |
testConnection()
Tests the connection associated with the database reference. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseReference()
| Method Detail |
|---|
public String getDirectDriverClassName()
public void setDirectDriverClassName(String driver)
driver - the database driver class namepublic String getDirectPassword()
public void setDirectPassword(String password)
password - the passwordpublic String getDirectUrl()
public void setDirectUrl(String url)
url - the database urlpublic String getDirectUsername()
public void setDirectUsername(String username)
username - the usernamepublic boolean getIsJndiBased()
public void setIsJndiBased(boolean isJndiBased)
isJndiBased - true if this reference is JNDI based
protected DataSource getJndiDataSource()
throws NamingException
NamingException - if a JNDI naming exception occurspublic String getJndiName()
public void setJndiName(String jndiName)
jndiName - the JNDI nameprotected String getReferenceLabel()
public String getReferenceName()
public void setReferenceName(String referenceName)
referenceName - the reference namepublic StringSet getTags()
public void closeConnection(Connection con)
con - the connection to close
public Connection openConnection()
throws ClassNotFoundException,
NamingException,
SQLException
ClassNotFoundException - if the database driver class was not found
NamingException - if a JNDI naming exception occurs
SQLException - if an SQL exception occurs while establishing the connection
protected Connection openDirectConnection()
throws ClassNotFoundException,
SQLException
ClassNotFoundException - if the database driver class was not found
SQLException - if an SQL exception occurs while establishing the connection
protected Connection openJndiConnection()
throws NamingException,
SQLException
NamingException - if a JNDI naming exception occurs
SQLException - if an SQL exception occurs while establishing the connection
protected DataSource openJndiDataSource(String jndiName)
throws NamingException
jndiName - the associated JNDI name
NamingException - if a JNDI naming exception occursprotected void testConnection()
public String toString()
toString in class Object
|
Esri Geoportal Server 1.2.9
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||