|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.cnes.sitools.datasource.jdbc.business.SitoolsSQLDataSource
public class SitoolsSQLDataSource
Encapsulation of javax.sql.DataSource for : - Schema connection management - Presentation of generic methods for SQL database consulting FIXME ne plus utiliser JdbcRowSet implementation de sun >> warning au runtime
| Constructor Summary | |
|---|---|
SitoolsSQLDataSource(JDBCDataSource key,
javax.sql.DataSource ds,
java.lang.String schemaOnConnection)
Object build by DataSource encapsulation |
|
| Method Summary | ||
|---|---|---|
java.lang.String |
addLimitOffset(java.lang.String sql,
int maxrows,
int offset)
To overload for each type of the database FIXME pas standard JDBC - à surcharger pour chaque type de BD |
|
java.sql.ResultSet |
basicQuery(java.lang.String sql,
int maxrows,
int fetchSize)
Make the SQL request |
|
void |
close()
Close all connections |
|
java.sql.Connection |
getConnection()
Permits to precise parameters of connection, such as schema |
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
|
DataSourceType |
getDataSourceType()
Get the type of the datasource |
|
javax.sql.DataSource |
getDs()
Gets the DataSource value |
|
SitoolsDataSourceModel |
getDsModel()
Gets the DataSource Model |
|
org.restlet.Restlet |
getExplorer()
Gets the explorer value |
|
int |
getLoginTimeout()
|
|
java.io.PrintWriter |
getLogWriter()
|
|
java.util.List<java.lang.String> |
getMetadata()
Deprecated. use getTables(String schemaPattern) instead |
|
java.util.List<java.lang.String> |
getMetadata(java.lang.String tableName)
Deprecated. - use getMetadata(Table) instead |
|
java.util.List<java.lang.String> |
getMetadata(Structure table)
Get the list of columns of a table |
|
java.util.logging.Logger |
getParentLogger()
Return the parent Logger of all the Loggers used by this data source. |
|
java.util.List<java.lang.String> |
getPrimaryKey(java.lang.String table)
Deprecated. user getPrimaryKey(Table) instead |
|
java.util.List<java.lang.String> |
getPrimaryKey(Structure table)
Retrieves primary keys of a table |
|
java.util.List<java.lang.String> |
getPrimaryKey(Table table)
Get the primary key of the table |
|
java.lang.String |
getSchemaOnConnection()
Gets the schemaOnConnection value |
|
java.util.List<Table> |
getTableList()
Gets the tableList value |
|
java.util.List<java.lang.String> |
getTableNameList()
Gets the tableNameList value |
|
java.util.List<Table> |
getTables(java.lang.String schemaPattern)
Return the list of tables in the database |
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
java.sql.ResultSet |
limitedQuery(java.lang.String sql,
int maxrows,
int offset)
Make the SQL request starting at offset and returning maxrows records |
|
void |
setDs(javax.sql.DataSource ds)
Sets the value of DataSource |
|
void |
setDsModel(SitoolsDataSourceModel dsModel)
Sets the data source model |
|
void |
setExplorer(org.restlet.Restlet explorer)
Sets the value of explorer |
|
void |
setLoginTimeout(int seconds)
|
|
void |
setLogWriter(java.io.PrintWriter out)
|
|
void |
setSchemaOnConnection(java.lang.String schemaOnConnection)
Sets the value of schemaOnConnection |
|
void |
setTableList(java.util.List<Table> tableList)
Sets the value of tableList |
|
void |
setTableNameList(java.util.List<java.lang.String> tableNameList)
Sets the value of tableNameList |
|
|
unwrap(java.lang.Class<T> iface)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SitoolsSQLDataSource(JDBCDataSource key,
javax.sql.DataSource ds,
java.lang.String schemaOnConnection)
ds - javax.sql.DataSourceschemaOnConnection - the schema connectionkey - the key associated to the source| Method Detail |
|---|
@Deprecated public java.util.List<java.lang.String> getMetadata(java.lang.String tableName)
tableName - the table name used
public java.util.List<java.lang.String> getMetadata(Structure table)
table - Table name
@Deprecated public java.util.List<java.lang.String> getPrimaryKey(java.lang.String table)
table - Table name
public java.util.List<java.lang.String> getPrimaryKey(Table table)
table - the table to look at
public java.util.List<java.lang.String> getPrimaryKey(Structure table)
table - Table object where name and schema are known
@Deprecated public java.util.List<java.lang.String> getMetadata()
public java.util.List<Table> getTables(java.lang.String schemaPattern)
schemaPattern - the schema pattern to access tables
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - when query fails
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLException
public int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLException
public void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLException
public void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
public java.sql.ResultSet basicQuery(java.lang.String sql,
int maxrows,
int fetchSize)
sql - SQL requestmaxrows - maximal number of rowsfetchSize - fetching size
public java.lang.String addLimitOffset(java.lang.String sql,
int maxrows,
int offset)
sql - SQL requestmaxrows - maximal number of rowsoffset - pagination position start
public java.sql.ResultSet limitedQuery(java.lang.String sql,
int maxrows,
int offset)
sql - SQL requestmaxrows - the maximal number of rowsoffset - the offset in rows
public SitoolsDataSourceModel getDsModel()
getDsModel in interface SitoolsDataSourcepublic void setDsModel(SitoolsDataSourceModel dsModel)
setDsModel in interface SitoolsDataSourcedsModel - the dsModel to setpublic javax.sql.DataSource getDs()
public void setDs(javax.sql.DataSource ds)
ds - the DataSource to setpublic java.lang.String getSchemaOnConnection()
public void setSchemaOnConnection(java.lang.String schemaOnConnection)
schemaOnConnection - the schemaOnConnection to setpublic org.restlet.Restlet getExplorer()
public void setExplorer(org.restlet.Restlet explorer)
explorer - the explorer to setpublic java.util.List<java.lang.String> getTableNameList()
public void setTableNameList(java.util.List<java.lang.String> tableNameList)
tableNameList - the tableNameList to setpublic java.util.List<Table> getTableList()
public void setTableList(java.util.List<Table> tableList)
tableList - the tableList to setpublic void close()
close in interface SitoolsDataSourcepublic DataSourceType getDataSourceType()
SitoolsDataSource
getDataSourceType in interface SitoolsDataSource
public java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
java.sql.SQLFeatureNotSupportedException - if the data source does not use java.util.logging.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||