edu.ucsb.nceas.dbadapter
Class SqlserverAdapter
java.lang.Object
|
+--edu.ucsb.nceas.dbadapter.AbstractDatabase
|
+--edu.ucsb.nceas.dbadapter.SqlserverAdapter
- public class SqlserverAdapter
- extends AbstractDatabase
The MS SQL Server db adapter implementation.
Method Summary |
java.lang.String |
getDateTimeFunction()
The SQL Server's function name that gets the current date and time
from the database server: "getdate()" |
java.lang.String |
getIsNULLFunction()
The SQL Server's function name that is used to return non-NULL value |
java.lang.String |
getStringDelimiter()
The SQL Server's string delimiter character: single quote (') |
long |
getUniqueID(java.sql.Connection conn,
java.lang.String tableName)
The SQL Server unique ID generator through use of IDENTITY key
The IDENTITY key is a column in the table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqlserverAdapter
public SqlserverAdapter()
getUniqueID
public long getUniqueID(java.sql.Connection conn,
java.lang.String tableName)
throws java.sql.SQLException
- The SQL Server unique ID generator through use of IDENTITY key
The IDENTITY key is a column in the table. When record is inserted
in the table, SELECT @@IDENTITY can return the key generated in
that IDENTITY column in the same db connection.
This is the only way to get unique id: let the SQL Server assign
a value in IDENTITY column and get it afterwards for use in the
application.
- Overrides:
getUniqueID
in class AbstractDatabase
- Parameters:
conn
- db connection in which to generate the unique idtableName
- the name of table which unique id to generate- Returns:
- return the generated unique id as a long type
- Throws:
java.sql.SQLException
-
any SQLException that can be thrown
during the db operation
getDateTimeFunction
public java.lang.String getDateTimeFunction()
- The SQL Server's function name that gets the current date and time
from the database server: "getdate()"
- Overrides:
getDateTimeFunction
in class AbstractDatabase
- Returns:
- return the current date and time function name: "getdate()"
getIsNULLFunction
public java.lang.String getIsNULLFunction()
- The SQL Server's function name that is used to return non-NULL value
- Overrides:
getIsNULLFunction
in class AbstractDatabase
- Returns:
- return the non-NULL function name: "isnull"
getStringDelimiter
public java.lang.String getStringDelimiter()
- The SQL Server's string delimiter character: single quote (')
- Overrides:
getStringDelimiter
in class AbstractDatabase
- Returns:
- return the string delimiter: single quote (')
Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.