Top Description Fields Constructors Methods
org.hsqldb.jdbc

public Class JDBCDataSourceFactory

extends Object
implements ObjectFactory
Class Inheritance
All Implemented Interfaces
javax.naming.spi.ObjectFactory
Imports
java.util.Hashtable, .Properties, javax.naming.Context, .Name, .Reference, .RefAddr, javax.naming.spi.ObjectFactory, javax.sql.DataSource

A JNDI ObjectFactory for creating data sources supported by HyperSQL JDBCDataSource for plain connections for the end user. JDBCPool for pooled plain connections for the end user. JDBCPooledDataSource for PooleConnection objects used by external connection pooling software. JDBCXADataSource for XAConnection objects used by external connection pooling software.
Authors
Darin DeForest (deforest@users dot sourceforge.net) original version, Fred Toussi (fredt@users dot sourceforge.net)
Version
2.7.3, 2.0.0

Field Summary

Modifier and TypeField and Description
private static final String
bdsClassName

class names

private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
urlName

supported properties

private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static DataSource

Returns:

the data source instance
createDataSource
(Properties
properties
props
)

Static method to create a JDBCDataSource instance using the given properties for url, user, password, etc.

public Object

Returns:

A newly created JDBCDataSource object; null if an object cannot be created.
getObjectInstance
(Object
The reference information used in creating a Datasource object.
obj
,
Name
ignored
name
,
Context
ignored
nameCtx
,
Hashtable<K, V>
ignored
environment
)

Implements javax.naming.spi.ObjectFactory.getObjectInstance.

Creates a DataSource object using the javax.naming.Reference object specified.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bdsClassNameback to summary
private static final String bdsClassName

class names

databaseNameback to summary
private static final String databaseName
loginTimeoutNameback to summary
private static final String loginTimeoutName
passwordNameback to summary
private static final String passwordName
pdsClassNameback to summary
private static final String pdsClassName
poolClassNameback to summary
private static final String poolClassName
urlNameback to summary
private static final String urlName

supported properties

userNameback to summary
private static final String userName
userNameNameback to summary
private static final String userNameName
xdsClassNameback to summary
private static final String xdsClassName

Constructor Detail

JDBCDataSourceFactoryback to summary
public JDBCDataSourceFactory()

Method Detail

createDataSourceback to summary
public static DataSource createDataSource(Properties props) throws Exception

Static method to create a JDBCDataSource instance using the given properties for url, user, password, etc.

Parameters
props:Properties

properties

Returns:DataSource

the data source instance

Exceptions
Exception:
on any error
getObjectInstanceback to summary
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<K, V> environment) throws Exception

Implements javax.naming.spi.ObjectFactory.getObjectInstance.

Creates a DataSource object using the javax.naming.Reference object specified.

The Reference object's class name should be one of the four supported data source class names and it must support the properties, database, user and password. It may optionally support the loginTimeout property. HyperSQL's JDBCPooledDataSource and JDBCXADataSource object are intended as factories used by a connection pooling DataSource.

JDBCDataSource is a factory for normal connections and can be accessed directly by user applications.

JDBCPool is a connection pool accessed directly by user applications.

Parameters
obj:Object

The reference information used in creating a Datasource object.

name:Name

ignored

nameCtx:Context

ignored

environment:Hashtable<K, V>

ignored

Returns:Object

A newly created JDBCDataSource object; null if an object cannot be created.

Exceptions
Exception:
is thrown if database or user is null or invalid