Class SqlServerDriverWrapper
java.lang.Object
com.illumon.iris.pqimport.gui.jdbc.SqlServerDriverWrapper
- All Implemented Interfaces:
IDriverWrapper
public class SqlServerDriverWrapper extends Object implements IDriverWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.pqimport.gui.jdbc.IDriverWrapper
IDriverWrapper.DisplayInfo, IDriverWrapper.DriverWrapperException, IDriverWrapper.Factory -
Field Summary
-
Constructor Summary
Constructors Constructor Description SqlServerDriverWrapper(com.fishlib.io.logger.Logger log) -
Method Summary
Modifier and Type Method Description StringcatalogName()What should the UI use to describe a catalog?StringdefaultUrl()What should the default URL for this driver be?StringdriverClass()The class used by JDBC for this driver.StringfriendlyName()For example "Mysql", "Oracle", "MS SQL Server"; shows up in the Combo Box dropdown of the different Drivers.String[]getCatalogNames(Connection connection)Get the list of Catalogs.TimeZonegetServerTimeZone(Connection connection)Return server time zone (for interpreting datetime values)String[]getTableNames(Connection connection, String catalogName)Get the list of tables within a catalog.booleanhasScrollableCursors()Return if the driver supports scrollable cursorsbooleanisValidUrl(String url)Check if this is a valid URL for this driver.StringquoteEscapeColumnName(String columnName)Quote and escape a column name in accordance with SQL Server, for use in a query.StringquoteEscapeTableName(String schemaName, String tableName)Quote and escape a table name in accordance with SQL Server convention, for use in a query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.pqimport.gui.jdbc.IDriverWrapper
displayInfo, load
-
Constructor Details
-
SqlServerDriverWrapper
public SqlServerDriverWrapper(com.fishlib.io.logger.Logger log)
-
-
Method Details
-
friendlyName
Description copied from interface:IDriverWrapperFor example "Mysql", "Oracle", "MS SQL Server"; shows up in the Combo Box dropdown of the different Drivers.- Specified by:
friendlyNamein interfaceIDriverWrapper- Returns:
- a friendly name for this driver wrapper
-
catalogName
Description copied from interface:IDriverWrapperWhat should the UI use to describe a catalog?- Specified by:
catalogNamein interfaceIDriverWrapper
-
defaultUrl
Description copied from interface:IDriverWrapperWhat should the default URL for this driver be?- Specified by:
defaultUrlin interfaceIDriverWrapper
-
driverClass
Description copied from interface:IDriverWrapperThe class used by JDBC for this driver.- Specified by:
driverClassin interfaceIDriverWrapper- Returns:
- the name of the class to load for this driver
-
isValidUrl
Description copied from interface:IDriverWrapperCheck if this is a valid URL for this driver.- Specified by:
isValidUrlin interfaceIDriverWrapper
-
hasScrollableCursors
public boolean hasScrollableCursors()Description copied from interface:IDriverWrapperReturn if the driver supports scrollable cursors- Specified by:
hasScrollableCursorsin interfaceIDriverWrapper- Returns:
-
getCatalogNames
Description copied from interface:IDriverWrapperGet the list of Catalogs. For our purposes, a catalog is simply a bucket of table names. Catalog matches the JDBC connection meta-data terminology; but does not map to all DBMSes.- Specified by:
getCatalogNamesin interfaceIDriverWrapper- Parameters:
connection- the JDBC connection- Returns:
- an array of catalog names
- Throws:
SQLException- when the underlying SQL operation fails
-
getTableNames
Description copied from interface:IDriverWrapperGet the list of tables within a catalog.- Specified by:
getTableNamesin interfaceIDriverWrapper- Parameters:
connection- the JDBC connectioncatalogName- the catalog to get names for- Returns:
- an array of table names
- Throws:
SQLException- when the underlying SQL operation fails
-
getServerTimeZone
Description copied from interface:IDriverWrapperReturn server time zone (for interpreting datetime values)- Specified by:
getServerTimeZonein interfaceIDriverWrapper- Throws:
SQLException
-
quoteEscapeTableName
Quote and escape a table name in accordance with SQL Server convention, for use in a query. This quotes the given schema (if given) and table name with square brackets escapes embedded closing brackets appropriately.- Specified by:
quoteEscapeTableNamein interfaceIDriverWrapper- Parameters:
schemaName- the raw unquoted, unescaped schema nametableName- the raw unquoted, unescaped table name- Returns:
- the quoted, escaped table name
-
quoteEscapeColumnName
Quote and escape a column name in accordance with SQL Server, for use in a query. This quotes the column name with square brackets escapes embedded closing brackets appropriately.- Specified by:
quoteEscapeColumnNamein interfaceIDriverWrapper- Parameters:
columnName- the raw unquoted, unescaped column name- Returns:
- the quoted, escaped column name
-