de.smartics.properties.spi.config.ds
Class JndiDataSourceProxy

Package class diagram package JndiDataSourceProxy
java.lang.Object
  extended by de.smartics.properties.spi.config.ds.JndiDataSourceProxy
All Implemented Interfaces:
DataSourceProxy, Serializable

public final class JndiDataSourceProxy
     
     
extends Object
implements DataSourceProxy

A vendor-neutral implementation using JNDI to access a data source.

See Also:
Serialized Form

Constructor Summary
JndiDataSourceProxy(String mappedName)
          Default constructor.
 
Method Summary
 String getCreateTableSqlTemplate()
          Provides an SQL template to create the configuration table.
 DataSource getDataSource()
          Provides access to the data source.
 String getDataSourceId()
          Returns the identifier of the data source.
 String getInsertOrUpdateSqlTemplate()
          Provides an SQL template to insert or update a value in the configuration table.
 void setInsertOrUpdate(PreparedStatement statement, String config, String name, String value)
          Sets the parameters to the given statement to insert or update a property in the configuration table.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JndiDataSourceProxy

public JndiDataSourceProxy(String mappedName)
                    throws NamingException
Default constructor.

Parameters:
mappedName - the JNDI name to access the data source.
Throws:
NamingException - if the data source cannot be fetched by the given name.
Method Detail

getDataSourceId

public String getDataSourceId()
Description copied from interface: DataSourceProxy
Returns the identifier of the data source.

Specified by:
getDataSourceId in interface DataSourceProxy
Returns:
the identifier of the data source.

getDataSource

public DataSource getDataSource()
Description copied from interface: DataSourceProxy
Provides access to the data source.

Specified by:
getDataSource in interface DataSourceProxy
Returns:
the data source.

getCreateTableSqlTemplate

public String getCreateTableSqlTemplate()
Description copied from interface: DataSourceProxy
Provides an SQL template to create the configuration table.

Specified by:
getCreateTableSqlTemplate in interface DataSourceProxy
Returns:
the SQL template to create the configuration table.

getInsertOrUpdateSqlTemplate

public String getInsertOrUpdateSqlTemplate()
Description copied from interface: DataSourceProxy
Provides an SQL template to insert or update a value in the configuration table.

Specified by:
getInsertOrUpdateSqlTemplate in interface DataSourceProxy
Returns:
the SQL template to insert or update a value in the configuration table.

setInsertOrUpdate

public void setInsertOrUpdate(PreparedStatement statement,
                              String config,
                              String name,
                              String value)
                       throws SQLException
Description copied from interface: DataSourceProxy
Sets the parameters to the given statement to insert or update a property in the configuration table.

The statement ist provided by DataSourceProxy.getInsertOrUpdateSqlTemplate().

Specified by:
setInsertOrUpdate in interface DataSourceProxy
Parameters:
statement - the statement to set the values.
config - the configuration key.
name - the property key.
value - the property value.
Throws:
SQLException - on any problem configuring the given statement.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.