org.hsqldb.jdbc
Class JDBCDataSourceFactory
java.lang.Object
org.hsqldb.jdbc.JDBCDataSourceFactory
- All Implemented Interfaces:
- ObjectFactory
public class JDBCDataSourceFactory
- extends Object
- implements ObjectFactory
A JNDI ObjectFactory for creating JDBCDataSource
object instances.
- Author:
- Darin DeForest (deforest@users dot sourceforge.net) original version, Fred Toussi (fredt@users dot sourceforge.net)
JDBCDataSourceFactory
public JDBCDataSourceFactory()
createDataSource
public static DataSource createDataSource(Properties props)
throws Exception
- Static method to create a JDBCDataSource instance using the
given properties for url, user, password, etc.
- Throws:
Exception
getObjectInstance
public Object getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable environment)
throws Exception
- Creates a JDBCDataSource, JDBCPooledDataSource or JDBCXADataSource object
using the javax.naming.Reference object specified.
The Reference object's class name should be one of the three supported
data source class names and it should support the properties, database,
user and password. It may optionally support the logingTimeout property.
- Specified by:
getObjectInstance in interface ObjectFactory
- Parameters:
obj - The reference information used in creating a
JDBCDatasource object.name - ignorednameCtx - ignoredenvironment - ignored
- Returns:
- A newly created JDBCDataSource object; null if an object
cannot be created.
- Throws:
Exception - is thrown if database or user is null or invalid
Copyright © 2001 - 2010 HSQL Development Group.