|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.ucsb.nceas.metacat.MetaCatUtil
A suite of utility classes for the metadata catalog server
Constructor Summary | |
MetaCatUtil()
Construct an instance of the utility class |
|
MetaCatUtil(java.lang.String propFile)
This constructor allows the usage of a different properties file |
Method Summary | |
void |
closeConnections()
|
static void |
debugMessage(int flag)
Utility method to print debugging messages |
static void |
debugMessage(java.lang.String msg)
Utility method to print debugging messages |
static java.net.URL |
fileToURL(java.io.File file)
Utility method to convert a file handle into a URL |
java.sql.Connection |
getConnection()
|
java.util.Hashtable |
getConnectionPool()
|
java.lang.String |
getOption(java.lang.String option_name)
Utility method to get an option value from the properties file |
int |
getPoolSize()
|
java.sql.Connection |
openDBConnection()
Utility method to establish a JDBC database connection using connection info from the properties file |
static java.sql.Connection |
openDBConnection(java.lang.String dbDriver,
java.lang.String connection,
java.lang.String user,
java.lang.String password)
Utility method to establish a JDBC database connection |
static java.util.Hashtable |
parseQuery(java.lang.String query)
Utility method to parse the query part of a URL into parameters. |
void |
returnConnection(java.sql.Connection returned)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MetaCatUtil()
public MetaCatUtil(java.lang.String propFile)
propFile
- the properties file that you wish to use.Method Detail |
public java.sql.Connection openDBConnection() throws java.sql.SQLException, java.lang.ClassNotFoundException
public static java.sql.Connection openDBConnection(java.lang.String dbDriver, java.lang.String connection, java.lang.String user, java.lang.String password) throws java.sql.SQLException, java.lang.ClassNotFoundException
dbDriver
- the string representing the database driverconnection
- the string representing the database connectin parametersuser
- name of the user to use for database connectionpassword
- password for the user to use for database connectionpublic java.lang.String getOption(java.lang.String option_name)
option_name
- the name of the option requestedpublic java.util.Hashtable getConnectionPool() throws java.sql.SQLException, java.lang.ClassNotFoundException
public java.sql.Connection getConnection() throws java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.Exception
public void returnConnection(java.sql.Connection returned)
public int getPoolSize()
public void closeConnections()
public static java.net.URL fileToURL(java.io.File file)
public static java.util.Hashtable parseQuery(java.lang.String query) throws java.net.MalformedURLException
public static void debugMessage(int flag)
flag
- an integer indicating the message numberpublic static void debugMessage(java.lang.String msg)
flag
- an integer indicating the message number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |