Java Doc for AbstractDBAdapter.java in  » Database-ORM » Torque » org » apache » torque » adapter » 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 » Torque » org.apache.torque.adapter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.torque.adapter.AbstractDBAdapter

All known Subclasses:   org.apache.torque.adapter.DBOdbc,  org.apache.torque.adapter.DBDerby,  org.apache.torque.adapter.DBDB2App,  org.apache.torque.adapter.DBInstantDB,  org.apache.torque.adapter.DBInformix,  org.apache.torque.adapter.DBPostgres,  org.apache.torque.adapter.DBWeblogic,  org.apache.torque.adapter.DBCloudscape,  org.apache.torque.adapter.DBSybase,  org.apache.torque.adapter.DBAxion,  org.apache.torque.adapter.DBFirebird,  org.apache.torque.adapter.DBHypersonicSQL,  org.apache.torque.adapter.DBMM,  org.apache.torque.adapter.DBOracle,  org.apache.torque.adapter.DBSapDB,  org.apache.torque.adapter.DBNone,  org.apache.torque.adapter.DBInterbase,
AbstractDBAdapter
abstract public class AbstractDBAdapter implements DB(Code)
This class is the abstract base for any database adapter Support for new databases is added by subclassing this class and implementing its abstract methods, and by registering the new database adapter and its corresponding JDBC driver in the service configuration file.

The Torque database adapters exist to present a uniform interface to database access across all available databases. Once the necessary adapters have been written and configured, transparent swapping of databases is theoretically supported with zero code changes and minimal configuration file modifications.

Torque uses the driver class name to find the right adapter. A JDBC driver corresponding to your adapter must be added to the properties file, using the fully-qualified class name of the driver. If no driver is specified for your database, driver.default is used.

 #### MySQL MM Driver
 database.default.driver=org.gjt.mm.mysql.Driver
 database.default.url=jdbc:mysql://localhost/DATABASENAME
 

author:
   Jon S. Stevens
author:
   Brett McLaughlin
author:
   Daniel Rall
author:
   Augustin Vidovic
version:
   $Id: DB.java 393063 2006-04-10 20:59:16Z tfischer $



Constructor Summary
protected  AbstractDBAdapter()
     Empty constructor.

Method Summary
public  booleanescapeText()
     This method is for the SqlExpression.quoteAndEscape rules.
public  voidgenerateLimits(Query query, int offset, int limit)
     This method is used to generate the database specific query extension to limit the number of record returned.
public  StringgetBooleanString(Boolean b)
     This method is used to format a boolean string.
public  StringgetDateString(Date date)
     This method is used to format any date string.
abstract public  StringgetIDMethodSQL(Object obj)
     Returns SQL used to get the most recently inserted primary key. Databases which have no support for this return null.
Parameters:
  obj - Information used for key generation.
abstract public  StringgetIDMethodType()
     Returns the constant from the org.apache.torque.adapter.IDMethod interface denoting which type of primary key generation method this type of RDBMS uses.
public  intgetLimitStyle()
     This method is used to check whether the database supports limiting the size of the resultset.
public  chargetStringDelimiter()
     Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote).
abstract public  StringignoreCase(String in)
     This method is used to ignore case.
Parameters:
  in - The string whose case to ignore.
public  StringignoreCaseInOrderBy(String in)
     This method is used to ignore case in an ORDER BY clause. Usually it is the same as ignoreCase, but some databases (Interbase for example) does not use the same SQL in ORDER BY and other clauses.
Parameters:
  in - The string whose case to ignore.
abstract public  voidlockTable(Connection con, String table)
     Locks the specified table.
public  booleansupportsNativeLimit()
     This method is used to check whether the database natively supports limiting the size of the resultset.
public  booleansupportsNativeOffset()
     This method is used to check whether the database natively supports returning results starting at an offset position other than 0.
abstract public  StringtoUpperCase(String in)
     This method is used to ignore case.
Parameters:
  in - The string to transform to upper case.
abstract public  voidunlockTable(Connection con, String table)
     Unlocks the specified table.
public  booleanuseEscapeClauseForLike()
     Whether an escape clause in like should be used. Example : select * from AUTHOR where AUTHOR.NAME like '\_%' ESCAPE '\'; As most databases do not need the escape clause, this implementation always returns false.
public  booleanuseIlike()
     Whether ILIKE should be used for case insensitive like clauses.


Constructor Detail
AbstractDBAdapter
protected AbstractDBAdapter()(Code)
Empty constructor.




Method Detail
escapeText
public boolean escapeText()(Code)
This method is for the SqlExpression.quoteAndEscape rules. The rule is, any string in a SqlExpression with a BACKSLASH will either be changed to "\\" or left as "\". SapDB does not need the escape character. true if the database needs to escape text in SqlExpressions.



generateLimits
public void generateLimits(Query query, int offset, int limit) throws TorqueException(Code)
This method is used to generate the database specific query extension to limit the number of record returned.
Parameters:
  query - The query to modify
Parameters:
  offset - the offset Value
Parameters:
  limit - the limit Value
throws:
  TorqueException - if any error occurs when building the query



getBooleanString
public String getBooleanString(Boolean b)(Code)
This method is used to format a boolean string.
Parameters:
  b - the Boolean to format The proper date formatted String.



getDateString
public String getDateString(Date date)(Code)
This method is used to format any date string. Database can use different default date formats.
Parameters:
  date - the Date to format The proper date formatted String.



getIDMethodSQL
abstract public String getIDMethodSQL(Object obj)(Code)
Returns SQL used to get the most recently inserted primary key. Databases which have no support for this return null.
Parameters:
  obj - Information used for key generation. The most recently inserted database key.



getIDMethodType
abstract public String getIDMethodType()(Code)
Returns the constant from the org.apache.torque.adapter.IDMethod interface denoting which type of primary key generation method this type of RDBMS uses. IDMethod constant



getLimitStyle
public int getLimitStyle()(Code)
This method is used to check whether the database supports limiting the size of the resultset. The limit style for the database.



getStringDelimiter
public char getStringDelimiter()(Code)
Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote). The text delimeter.



ignoreCase
abstract public String ignoreCase(String in)(Code)
This method is used to ignore case.
Parameters:
  in - The string whose case to ignore. The string in a case that can be ignored.



ignoreCaseInOrderBy
public String ignoreCaseInOrderBy(String in)(Code)
This method is used to ignore case in an ORDER BY clause. Usually it is the same as ignoreCase, but some databases (Interbase for example) does not use the same SQL in ORDER BY and other clauses.
Parameters:
  in - The string whose case to ignore. The string in a case that can be ignored.



lockTable
abstract public void lockTable(Connection con, String table) throws SQLException(Code)
Locks the specified table.
Parameters:
  con - The JDBC connection to use.
Parameters:
  table - The name of the table to lock.
throws:
  SQLException - No Statement could be created or executed.



supportsNativeLimit
public boolean supportsNativeLimit()(Code)
This method is used to check whether the database natively supports limiting the size of the resultset. True if the database natively supports limiting thesize of the resultset.



supportsNativeOffset
public boolean supportsNativeOffset()(Code)
This method is used to check whether the database natively supports returning results starting at an offset position other than 0. True if the database natively supports returningresults starting at an offset position other than 0.



toUpperCase
abstract public String toUpperCase(String in)(Code)
This method is used to ignore case.
Parameters:
  in - The string to transform to upper case. The upper case string.



unlockTable
abstract public void unlockTable(Connection con, String table) throws SQLException(Code)
Unlocks the specified table.
Parameters:
  con - The JDBC connection to use.
Parameters:
  table - The name of the table to unlock.
throws:
  SQLException - No Statement could be created or executed.



useEscapeClauseForLike
public boolean useEscapeClauseForLike()(Code)
Whether an escape clause in like should be used. Example : select * from AUTHOR where AUTHOR.NAME like '\_%' ESCAPE '\'; As most databases do not need the escape clause, this implementation always returns false. This behaviour can be overwritten in subclasses. whether the escape clause should be appended or not.



useIlike
public boolean useIlike()(Code)
Whether ILIKE should be used for case insensitive like clauses. As most databases do not use ILIKE, this implementation returns false. This behaviour may be overwritten in subclasses. true if ilike should be used for case insensitive likes,false if ignoreCase should be applied to the compared strings.



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.