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 String
catalogName()
What should the UI use to describe a catalog?String
defaultUrl()
What should the default URL for this driver be?String
driverClass()
The class used by JDBC for this driver.String
friendlyName()
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.TimeZone
getServerTimeZone(Connection connection)
Return server time zone (for interpreting datetime values)String[]
getTableNames(Connection connection, String catalogName)
Get the list of tables within a catalog.boolean
hasScrollableCursors()
Return if the driver supports scrollable cursorsboolean
isValidUrl(String url)
Check if this is a valid URL for this driver.String
quoteEscapeColumnName(String columnName)
Quote and escape a column name in accordance with SQL Server, for use in a query.String
quoteEscapeTableName(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, wait
Methods 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:IDriverWrapper
For example "Mysql", "Oracle", "MS SQL Server"; shows up in the Combo Box dropdown of the different Drivers.- Specified by:
friendlyName
in interfaceIDriverWrapper
- Returns:
- a friendly name for this driver wrapper
-
catalogName
Description copied from interface:IDriverWrapper
What should the UI use to describe a catalog?- Specified by:
catalogName
in interfaceIDriverWrapper
-
defaultUrl
Description copied from interface:IDriverWrapper
What should the default URL for this driver be?- Specified by:
defaultUrl
in interfaceIDriverWrapper
-
driverClass
Description copied from interface:IDriverWrapper
The class used by JDBC for this driver.- Specified by:
driverClass
in interfaceIDriverWrapper
- Returns:
- the name of the class to load for this driver
-
isValidUrl
Description copied from interface:IDriverWrapper
Check if this is a valid URL for this driver.- Specified by:
isValidUrl
in interfaceIDriverWrapper
-
hasScrollableCursors
public boolean hasScrollableCursors()Description copied from interface:IDriverWrapper
Return if the driver supports scrollable cursors- Specified by:
hasScrollableCursors
in interfaceIDriverWrapper
- Returns:
-
getCatalogNames
Description copied from interface:IDriverWrapper
Get 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:
getCatalogNames
in 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:IDriverWrapper
Get the list of tables within a catalog.- Specified by:
getTableNames
in 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:IDriverWrapper
Return server time zone (for interpreting datetime values)- Specified by:
getServerTimeZone
in 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:
quoteEscapeTableName
in 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:
quoteEscapeColumnName
in interfaceIDriverWrapper
- Parameters:
columnName
- the raw unquoted, unescaped column name- Returns:
- the quoted, escaped column name
-