Java Doc for DatabaseAdapter.java in  » Database-ORM » TJDO » com » triactive » jdo » store » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » TJDO » com.triactive.jdo.store 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.triactive.jdo.store.DatabaseAdapter

All known Subclasses:   com.triactive.jdo.store.HSQLDBAdapter,  com.triactive.jdo.store.FirebirdAdapter,  com.triactive.jdo.store.MSSQLServerAdapter,  com.triactive.jdo.store.SAPDBAdapter,  com.triactive.jdo.store.PointBaseAdapter,  com.triactive.jdo.store.OracleAdapter,  com.triactive.jdo.store.CloudscapeAdapter,  com.triactive.jdo.store.MySQLAdapter,  com.triactive.jdo.store.DB2Adapter,  com.triactive.jdo.store.PostgreSQLAdapter,
DatabaseAdapter
public class DatabaseAdapter (Code)
Provides methods for adapting SQL language elements to a specific vendor's database. A database adapter is primarily used to map generic JDBC data types and SQL identifiers to specific types/identifiers suitable for the database in use.

Each database adapter corresponds to a particular combination of database, database version, driver, and driver version, as provided by the driver's own metadata. Database adapters cannot be constructed directly, but must be obtained using the DatabaseAdapter.getInstance method.
author:
   Mike Martin
author:
   Christopher Walk
version:
   $Revision: 1.30 $
See Also:   java.sql.DatabaseMetaData



Field Summary
protected  intdatabaseMajorVersion
     The major version number of the underlying database.
protected  intdatabaseMinorVersion
     The minor version number of the underlying database.
protected  StringdatabaseProductName
     The name of the underlying database.
protected  StringdatabaseProductVersion
     The version number of the underlying database as a string.
protected  StringidentifierQuoteString
     The String used to quote SQL identifiers.
final protected  HashSetkeywords
     The set of SQL keywords for this DBMS, in upper-case.
protected  intmaxColumnNameLength
     The maximum length to be used for a column name.
protected  intmaxConstraintNameLength
     The maximum length to be used for a table constraint name.
protected  intmaxIndexNameLength
     The maximum length to be used for an index name.
protected  intmaxTableNameLength
     The maximum length to be used for a table name.
protected  booleanstoresLowerCaseIdentifiers
     true if the database stores all identifiers in lower-case.
protected  booleanstoresUpperCaseIdentifiers
     true if the database stores all identifiers in upper-case.
final protected  HashMaptypeMappings
    
final protected  HashMaptypesByTypeNumber
    

Constructor Summary
protected  DatabaseAdapter(DatabaseMetaData metadata)
     Constructs a database adapter based on the given JDBC metadata.

Method Summary
public  voidcloseConnection(Connection conn)
    
public  booleancreateIndexesBeforeForeignKeys()
    
protected  voidcreateTypeInfo(DatabaseMetaData metadata)
     Creates TypeInfo objects for all of the data types and indexes them in the typesByTypeNumber map by their JDBC data type number.
public  StringgetAddCandidateKeyStatement(SQLIdentifier ckName, CandidateKey ck)
     Returns the appropriate SQL to add a candidate key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ)
 

Parameters:
  ckName - The name of the candidate key to add.
Parameters:
  ck - An object describing the candidate key.
public  StringgetAddForeignKeyStatement(SQLIdentifier fkName, ForeignKey fk)
     Returns the appropriate SQL to add a foreign key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
 

Parameters:
  fkName - The name of the foreign key to add.
Parameters:
  fk - An object describing the foreign key.
public  StringgetAddPrimaryKeyStatement(SQLIdentifier pkName, PrimaryKey pk)
     Returns the appropriate SQL to add a primary key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR)
 

Parameters:
  pkName - The name of the primary key to add.
Parameters:
  pk - An object describing the primary key.
public  ConnectiongetConnection(DataSource ds, String userName, String password, int isolationLevel)
    
public  StringgetCreateIndexStatement(SQLIdentifier idxName, Index idx)
     Returns the appropriate SQL to add an index to its table. It should return something like:

 CREATE INDEX FOO_N1 ON FOO (BAR,BAZ)
 CREATE UNIQUE INDEX FOO_U1 ON FOO (BAR,BAZ)
 

Parameters:
  idxName - The name of the index to add.
Parameters:
  idx - An object describing the index.
public  StringgetCreateTableStatement(BaseTable table, Column[] columns)
     Returns the appropriate SQL to create the given table having the given columns.
public  StringgetDropTableStatement(BaseTable table)
     Returns the appropriate SQL to drop the given table. It should return something like:

 DROP TABLE FOO CASCADE
 

Parameters:
  table - The table to drop.
public  StringgetDropViewStatement(View view)
     Returns the appropriate SQL to drop the given view. It should return something like:

 DROP VIEW FOO
 

Parameters:
  view - The view to drop.
public  StringgetIdentifierQuoteString()
    
public static synchronized  DatabaseAdaptergetInstance(Connection conn)
     Returns a DatabaseAdapter object appropriate for the database currently underlying the given Connection .
public  MappinggetMapping(Class c)
    
public  ColumnMappinggetMapping(Column col)
    
public  MappinggetMapping(ClassBaseTable table, int relativeFieldNumber)
    
protected  ClassgetMappingClass(Class c)
    
public  intgetMaxColumnNameLength()
    
public  intgetMaxConstraintNameLength()
    
public  intgetMaxIndexNameLength()
    
public  intgetMaxTableNameLength()
    
public  SQLStategetSQLState(SQLException se)
     Returns a SQLState object for the specified SQLException, if one is present and valid.
public  StringgetSchemaName(Connection conn)
    
public  TypeInfogetTypeInfo(int dataType)
     Returns type information for the database type that best implements the given JDBC type.
Parameters:
  dataType - JDBC type number of the data type.
public  TypeInfogetTypeInfo(int[] candidateDataTypes)
     Returns type information for the first one of the given candidate JDBC data types supported by this database.
Parameters:
  candidateDataTypes - array of JDBC type numbers of the data types to be checkedin order of preference.
public  intgetUnlimitedLengthPrecisionValue(TypeInfo typeInfo)
     Returns the precision value to be used when creating string columns of "unlimited" length.
public  StringgetVendorID()
    
public  booleanincludeOrderByColumnsInSelect()
    
public  booleanisEmbeddedType(Class c)
    
public  booleanisSQLKeyword(String word)
     Tests if a given string is a SQL key word.

The list of key words tested against is defined to contain all SQL/92 key words, plus any additional key words reported by the JDBC driver for this adapter via DatabaseMetaData.getSQLKeywords().

In general, use of a SQL key word as an identifier should be avoided. SQL/92 key words are divided into reserved and non-reserved words. If a reserved word is used as an identifier it must be quoted with double quotes. Strictly speaking, the same is not true of non-reserved words. However, as C.J.

public  NumericExpressionlengthMethod(CharacterExpression str)
     Returns the appropriate SQL expression for the JDOQL String.length() method. It should return something like:

 CHAR_LENGTH(str)
 

Parameters:
  str - The argument to the length() method.
public  ColumnInfonewColumnInfo(ResultSet rs)
     A factory for ColumnInfo objects.
public  JDOExceptionnewDataStoreException(String message, SQLException e)
     Create the appropriate JDODataStoreException or JDOFatalDataStoreException for the given SQLException based on whether the action causing the exception has aborted the current transaction.

For historical reasons, the design of this method is flawed. To conform correctly to the spec, if a JDOFatalDataStoreException is returned then there should be some coordination with the appropriate PersistenceManager and its Transaction to allow them to reflect the fact that a transaction is no longer active. At the least, that means that this method would have to be passed a reference to a PersistenceManager.

An outstanding question remains how we can reliably determine via JDBC whether or not a failed statement has aborted the current database transaction. Bottom line, this area is ripe for refactoring.

The current implementation in this class always returns a new JDODataStoreException and never a JDOFatalDataStoreException.
Parameters:
  message - The message to include in the JDODataStoreException.
Parameters:
  e - The SQLException to create a JDODataStoreException for.

public  ForeignKeyInfonewForeignKeyInfo(ResultSet rs)
     A factory for ForeignKeyInfo objects.
public  QueryStatementnewQueryStatement(Table table)
    
public  QueryStatementnewQueryStatement(Table table, SQLIdentifier rangeVar)
    
public  TableExpressionnewTableExpression(QueryStatement qs, Table table, SQLIdentifier rangeVar)
     Returns a new TableExpression object appropriate for this DBMS. This should be an instance of one of the three built-in styles of table expression:
  • TableExprAsJoins
  • TableExprAsSubjoins
  • TableExprAsSubquery
TableExprAsSubjoins is the default, which arguably produces the most readable SQL but doesn't work on all DBMS's.
protected  TypeInfonewTypeInfo(ResultSet rs)
     A factory for TypeInfo objects.
protected  SetparseKeywordList(String list)
    
public  booleanstoresLowerCaseIdentifiers()
    
public  booleanstoresUpperCaseIdentifiers()
    
public  CharacterExpressionsubstringMethod(CharacterExpression str, NumericExpression begin)
     Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. It should return something like:

 SUBSTRING(str FROM begin)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1.
Parameters:
  str - The first argument to the substring() method.
Parameters:
  begin - The second argument to the substring() method.
public  CharacterExpressionsubstringMethod(CharacterExpression str, NumericExpression begin, NumericExpression end)
     Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. It should return something like:

 SUBSTRING(str FROM begin FOR len)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.
Parameters:
  str - The first argument to the substring() method.
Parameters:
  begin - The second argument to the substring() method.
Parameters:
  end - The third argument to the substring() method.
public  booleansupportsAlterTableDropConstraint()
    
public  booleansupportsBooleanComparison()
     Indicates whether or not two boolean expressions can be directly compared to each other using the = or <> operator.
public  booleansupportsDeferredConstraints()
    
public  booleansupportsNullsInCandidateKeys()
    
public  StringtoString()
    

Field Detail
databaseMajorVersion
protected int databaseMajorVersion(Code)
The major version number of the underlying database.



databaseMinorVersion
protected int databaseMinorVersion(Code)
The minor version number of the underlying database.



databaseProductName
protected String databaseProductName(Code)
The name of the underlying database.



databaseProductVersion
protected String databaseProductVersion(Code)
The version number of the underlying database as a string.



identifierQuoteString
protected String identifierQuoteString(Code)
The String used to quote SQL identifiers.



keywords
final protected HashSet keywords(Code)
The set of SQL keywords for this DBMS, in upper-case.



maxColumnNameLength
protected int maxColumnNameLength(Code)
The maximum length to be used for a column name.



maxConstraintNameLength
protected int maxConstraintNameLength(Code)
The maximum length to be used for a table constraint name.



maxIndexNameLength
protected int maxIndexNameLength(Code)
The maximum length to be used for an index name.



maxTableNameLength
protected int maxTableNameLength(Code)
The maximum length to be used for a table name.



storesLowerCaseIdentifiers
protected boolean storesLowerCaseIdentifiers(Code)
true if the database stores all identifiers in lower-case.



storesUpperCaseIdentifiers
protected boolean storesUpperCaseIdentifiers(Code)
true if the database stores all identifiers in upper-case.



typeMappings
final protected HashMap typeMappings(Code)



typesByTypeNumber
final protected HashMap typesByTypeNumber(Code)




Constructor Detail
DatabaseAdapter
protected DatabaseAdapter(DatabaseMetaData metadata)(Code)
Constructs a database adapter based on the given JDBC metadata.
Parameters:
  metadata - the database metadata.




Method Detail
closeConnection
public void closeConnection(Connection conn) throws SQLException(Code)



createIndexesBeforeForeignKeys
public boolean createIndexesBeforeForeignKeys()(Code)



createTypeInfo
protected void createTypeInfo(DatabaseMetaData metadata) throws SQLException(Code)
Creates TypeInfo objects for all of the data types and indexes them in the typesByTypeNumber map by their JDBC data type number.



getAddCandidateKeyStatement
public String getAddCandidateKeyStatement(SQLIdentifier ckName, CandidateKey ck)(Code)
Returns the appropriate SQL to add a candidate key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_CK UNIQUE (BAZ)
 

Parameters:
  ckName - The name of the candidate key to add.
Parameters:
  ck - An object describing the candidate key. The text of the SQL statement.



getAddForeignKeyStatement
public String getAddForeignKeyStatement(SQLIdentifier fkName, ForeignKey fk)(Code)
Returns the appropriate SQL to add a foreign key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_FK1 FOREIGN KEY (BAR, BAZ) REFERENCES ABC (COL1, COL2)
 

Parameters:
  fkName - The name of the foreign key to add.
Parameters:
  fk - An object describing the foreign key. The text of the SQL statement.



getAddPrimaryKeyStatement
public String getAddPrimaryKeyStatement(SQLIdentifier pkName, PrimaryKey pk)(Code)
Returns the appropriate SQL to add a primary key to its table. It should return something like:

 ALTER TABLE FOO ADD CONSTRAINT FOO_PK PRIMARY KEY (BAR)
 

Parameters:
  pkName - The name of the primary key to add.
Parameters:
  pk - An object describing the primary key. The text of the SQL statement.



getConnection
public Connection getConnection(DataSource ds, String userName, String password, int isolationLevel) throws SQLException(Code)



getCreateIndexStatement
public String getCreateIndexStatement(SQLIdentifier idxName, Index idx)(Code)
Returns the appropriate SQL to add an index to its table. It should return something like:

 CREATE INDEX FOO_N1 ON FOO (BAR,BAZ)
 CREATE UNIQUE INDEX FOO_U1 ON FOO (BAR,BAZ)
 

Parameters:
  idxName - The name of the index to add.
Parameters:
  idx - An object describing the index. The text of the SQL statement.



getCreateTableStatement
public String getCreateTableStatement(BaseTable table, Column[] columns)(Code)
Returns the appropriate SQL to create the given table having the given columns. No column constraints or key definitions should be included. It should return something like:

 CREATE TABLE FOO ( BAR VARCHAR(30), BAZ INTEGER )
 

Parameters:
  table - The table to create.
Parameters:
  columns - The columns of the table. The text of the SQL statement.



getDropTableStatement
public String getDropTableStatement(BaseTable table)(Code)
Returns the appropriate SQL to drop the given table. It should return something like:

 DROP TABLE FOO CASCADE
 

Parameters:
  table - The table to drop. The text of the SQL statement.



getDropViewStatement
public String getDropViewStatement(View view)(Code)
Returns the appropriate SQL to drop the given view. It should return something like:

 DROP VIEW FOO
 

Parameters:
  view - The view to drop. The text of the SQL statement.



getIdentifierQuoteString
public String getIdentifierQuoteString()(Code)



getInstance
public static synchronized DatabaseAdapter getInstance(Connection conn) throws SQLException(Code)
Returns a DatabaseAdapter object appropriate for the database currently underlying the given Connection . Multiple calls to this method with connections having the same database/driver/version will return the same DatabaseAdapter object.
Parameters:
  conn - An open database connection. a database adapter object for the database underlying thegiven connection.
exception:
  SQLException - If a database error occurs.



getMapping
public Mapping getMapping(Class c)(Code)



getMapping
public ColumnMapping getMapping(Column col)(Code)



getMapping
public Mapping getMapping(ClassBaseTable table, int relativeFieldNumber)(Code)



getMappingClass
protected Class getMappingClass(Class c)(Code)



getMaxColumnNameLength
public int getMaxColumnNameLength()(Code)



getMaxConstraintNameLength
public int getMaxConstraintNameLength()(Code)



getMaxIndexNameLength
public int getMaxIndexNameLength()(Code)



getMaxTableNameLength
public int getMaxTableNameLength()(Code)



getSQLState
public SQLState getSQLState(SQLException se)(Code)
Returns a SQLState object for the specified SQLException, if one is present and valid.
Parameters:
  se - A caught SQL exception.A SQLState object, or null if se does notcontain a valid 5-character SQLSTATE.



getSchemaName
public String getSchemaName(Connection conn) throws SQLException(Code)



getTypeInfo
public TypeInfo getTypeInfo(int dataType) throws UnsupportedDataTypeException(Code)
Returns type information for the database type that best implements the given JDBC type.
Parameters:
  dataType - JDBC type number of the data type. type information for the best matching type.



getTypeInfo
public TypeInfo getTypeInfo(int[] candidateDataTypes) throws UnsupportedDataTypeException(Code)
Returns type information for the first one of the given candidate JDBC data types supported by this database.
Parameters:
  candidateDataTypes - array of JDBC type numbers of the data types to be checkedin order of preference. type information for the first supported type.



getUnlimitedLengthPrecisionValue
public int getUnlimitedLengthPrecisionValue(TypeInfo typeInfo)(Code)
Returns the precision value to be used when creating string columns of "unlimited" length. Usually, if this value is needed it is provided in the database metadata ( TypeInfo.precision ). However, for some types in some databases the value must be computed specially.
Parameters:
  typeInfo - the typeInfo object for which the precision value isneeded. the precision value to be used when creating the column, or -1if no value should be used.



getVendorID
public String getVendorID()(Code)



includeOrderByColumnsInSelect
public boolean includeOrderByColumnsInSelect()(Code)



isEmbeddedType
public boolean isEmbeddedType(Class c)(Code)



isSQLKeyword
public boolean isSQLKeyword(String word)(Code)
Tests if a given string is a SQL key word.

The list of key words tested against is defined to contain all SQL/92 key words, plus any additional key words reported by the JDBC driver for this adapter via DatabaseMetaData.getSQLKeywords().

In general, use of a SQL key word as an identifier should be avoided. SQL/92 key words are divided into reserved and non-reserved words. If a reserved word is used as an identifier it must be quoted with double quotes. Strictly speaking, the same is not true of non-reserved words. However, as C.J. Date writes in A Guide To The SQL Standard:

The rule by which it is determined within the standard that one key word needs to be reserved while another need not is not clear to this writer. In practice, it is probably wise to treat all key words as reserved.

Parameters:
  word - The word to test. true if word is a SQL key word for thisDBMS. The comparison is case-insensitive.
See Also:   SQL92Constants



lengthMethod
public NumericExpression lengthMethod(CharacterExpression str)(Code)
Returns the appropriate SQL expression for the JDOQL String.length() method. It should return something like:

 CHAR_LENGTH(str)
 

Parameters:
  str - The argument to the length() method. The text of the SQL expression.



newColumnInfo
public ColumnInfo newColumnInfo(ResultSet rs)(Code)
A factory for ColumnInfo objects. This method should always be used instead of directly constructing ColumnInfo objects in order to give the DatabaseAdapter an opportunity to modify and/or correct the metadata obtained from the JDBC driver. The column information object is constructed from the current row of the given result set. The ResultSet object passed must have been obtained from a call to DatabaseMetaData.getColumns().

The constructor only retrieves the values from the current row; the caller is required to advance to the next row with ResultSet.next .
Parameters:
  rs - The result set returned from DatabaseMetaData.getColumns().




newDataStoreException
public JDOException newDataStoreException(String message, SQLException e)(Code)
Create the appropriate JDODataStoreException or JDOFatalDataStoreException for the given SQLException based on whether the action causing the exception has aborted the current transaction.

For historical reasons, the design of this method is flawed. To conform correctly to the spec, if a JDOFatalDataStoreException is returned then there should be some coordination with the appropriate PersistenceManager and its Transaction to allow them to reflect the fact that a transaction is no longer active. At the least, that means that this method would have to be passed a reference to a PersistenceManager.

An outstanding question remains how we can reliably determine via JDBC whether or not a failed statement has aborted the current database transaction. Bottom line, this area is ripe for refactoring.

The current implementation in this class always returns a new JDODataStoreException and never a JDOFatalDataStoreException.
Parameters:
  message - The message to include in the JDODataStoreException.
Parameters:
  e - The SQLException to create a JDODataStoreException for. A JDODataStoreException orJDOFatalDataStoreException that wraps thegiven SQLException. A fatal exception is usedto indicate that the active transaction has been aborted.




newForeignKeyInfo
public ForeignKeyInfo newForeignKeyInfo(ResultSet rs)(Code)
A factory for ForeignKeyInfo objects. This method should always be used instead of directly constructing ForeignKeyInfo objects in order to give the DatabaseAdapter an opportunity to modify and/or correct the metadata obtained from the JDBC driver. The column information object is constructed from the current row of the given result set. The ResultSet object passed must have been obtained from a call to DatabaseMetaData.getImportedKeys() or DatabaseMetaData.getExportedKeys().

The constructor only retrieves the values from the current row; the caller is required to advance to the next row with ResultSet.next .
Parameters:
  rs - The result set returned from DatabaseMetaData.get??portedKeys().




newQueryStatement
public QueryStatement newQueryStatement(Table table)(Code)



newQueryStatement
public QueryStatement newQueryStatement(Table table, SQLIdentifier rangeVar)(Code)



newTableExpression
public TableExpression newTableExpression(QueryStatement qs, Table table, SQLIdentifier rangeVar)(Code)
Returns a new TableExpression object appropriate for this DBMS. This should be an instance of one of the three built-in styles of table expression:
  • TableExprAsJoins
  • TableExprAsSubjoins
  • TableExprAsSubquery
TableExprAsSubjoins is the default, which arguably produces the most readable SQL but doesn't work on all DBMS's. TableExprAsSubjoins should work anywhere, but may be less efficient.
Parameters:
  qs - The query statement in which the table expression willbe included.
Parameters:
  table - The main table in the expression.
Parameters:
  rangeVar - The SQL alias, or "range variable", to assign to theexpression or to the main table.



newTypeInfo
protected TypeInfo newTypeInfo(ResultSet rs)(Code)
A factory for TypeInfo objects. This method should always be used instead of directly constructing TypeInfo objects in order to give the DatabaseAdapter an opportunity to modify and/or correct the metadata obtained from the JDBC driver. The type information object is constructed from the current row of the given result set. The ResultSet object passed must have been obtained from a call to DatabaseMetaData.getTypeInfo().

The constructor only retrieves the values from the current row; the caller is required to advance to the next row with ResultSet.next .
Parameters:
  rs - The result set returned from DatabaseMetaData.getTypeInfo().A TypeInfo object constructed from the current result set row, ornull if the type indicated by this row should beexcluded from use.




parseKeywordList
protected Set parseKeywordList(String list)(Code)



storesLowerCaseIdentifiers
public boolean storesLowerCaseIdentifiers()(Code)



storesUpperCaseIdentifiers
public boolean storesUpperCaseIdentifiers()(Code)



substringMethod
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin)(Code)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin) method. It should return something like:

 SUBSTRING(str FROM begin)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1.
Parameters:
  str - The first argument to the substring() method.
Parameters:
  begin - The second argument to the substring() method. The text of the SQL expression.



substringMethod
public CharacterExpression substringMethod(CharacterExpression str, NumericExpression begin, NumericExpression end)(Code)
Returns the appropriate SQL expression for the JDOQL String.substring(str,begin,end) method. It should return something like:

 SUBSTRING(str FROM begin FOR len)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.
Parameters:
  str - The first argument to the substring() method.
Parameters:
  begin - The second argument to the substring() method.
Parameters:
  end - The third argument to the substring() method. The text of the SQL expression.



supportsAlterTableDropConstraint
public boolean supportsAlterTableDropConstraint()(Code)



supportsBooleanComparison
public boolean supportsBooleanComparison()(Code)
Indicates whether or not two boolean expressions can be directly compared to each other using the = or <> operator. Some DBMS's allow you to say WHERE (X = 12) = (Y = 34), others don't.

The default value returned by the implementation in this class is true. true if boolean expressions can be compared,false otherwise.




supportsDeferredConstraints
public boolean supportsDeferredConstraints()(Code)



supportsNullsInCandidateKeys
public boolean supportsNullsInCandidateKeys()(Code)



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.