Java Doc for DatabaseTable.java in  » XML-UI » XUI » net » xoetrope » optional » data » sql » 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 » XML UI » XUI » net.xoetrope.optional.data.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.xoetrope.optional.data.sql.DatabaseTable

All known Subclasses:   net.xoetrope.optional.data.sql.CachedDatabaseTable,
DatabaseTable
public class DatabaseTable (Code)
A holder for information about a database table and the result set obtained from a database query.

Copyright (c) Xoetrope Ltd. 2001-2003

$Revision: 1.8 $


Field Summary
final public static  intNORMAL_UPDATE
    
final public static  intOPTIMISTIC_UPDATE
    
final public static  intPARANOID_UPDATE
    
protected  ResultSetRS
    
protected static  booleancaseSensitive
    
protected  StringconnName
    
protected  DataConnectionconnection
    
protected  intcurrentRow
    
protected  StringdefaultWhereClause
    
protected  booleandirty
    
protected  booleandistinct
    
protected  intnumFields
    
protected  intnumRows
    
protected  StringorderField
    
protected  StringqueryFields
    
protected  StringqueryTable
    
protected  StringsqlStatement
    
protected  booleanwritable
    

Constructor Summary
public  DatabaseTable(String tableName)
    
public  DatabaseTable(String sql, String conn, boolean allowWrites)
    
public  DatabaseTable(String tableName, String fields, String where, String conn, boolean allowWrites)
    

Method Summary
protected  voidcacheData()
    
public  intexecuteUpdate(String sql)
    
protected  voidfinalize()
    
public  voidfirst()
    
public  StringgetConnName()
    
public  intgetCurrentRow()
     Gets the current row.
public  intgetFieldIndex(String fieldName)
    
public  StringgetFieldName(int fieldIdx)
    
public  StringgetFields()
    
public  intgetNumFields()
    
public  intgetNumRows()
    
public  StringgetSQL(String where)
    
public  StringgetTableName()
    
public  voidgetTableName(String name)
    
public  StringgetValue(int fieldIdx)
    
public  StringgetValue(int rowIdx, int fieldIdx)
    
public  StringgetWhereClause()
    
public  booleanisDistinct()
    
public  voidlast()
    
public  booleannext()
    
public  booleanprevious()
    
public  voidretrieve()
    
public  voidretrieve(String where)
     Retrieve values using the specified where clause.
public static  voidsetCaseSensitive(boolean state)
     Set the case sensitivity for database comparisons.
public  voidsetCurrentRow(int idx)
     Sets the current row.
public  voidsetDistinct(boolean isDistinct)
    
public  voidsetOrderField(String fld)
    
public  voidsetValue(int rowIdx, int fieldIdx, String value)
    

Field Detail
NORMAL_UPDATE
final public static int NORMAL_UPDATE(Code)
The database will attempt to synchronize periodically



OPTIMISTIC_UPDATE
final public static int OPTIMISTIC_UPDATE(Code)
The database will only attempt to synchronize when absolutely necessary



PARANOID_UPDATE
final public static int PARANOID_UPDATE(Code)
The database will always attemp to synchronize



RS
protected ResultSet RS(Code)



caseSensitive
protected static boolean caseSensitive(Code)



connName
protected String connName(Code)



connection
protected DataConnection connection(Code)



currentRow
protected int currentRow(Code)



defaultWhereClause
protected String defaultWhereClause(Code)



dirty
protected boolean dirty(Code)



distinct
protected boolean distinct(Code)



numFields
protected int numFields(Code)



numRows
protected int numRows(Code)



orderField
protected String orderField(Code)



queryFields
protected String queryFields(Code)



queryTable
protected String queryTable(Code)



sqlStatement
protected String sqlStatement(Code)



writable
protected boolean writable(Code)




Constructor Detail
DatabaseTable
public DatabaseTable(String tableName)(Code)
Create a new database table wrapper
Parameters:
  tableName - the table name



DatabaseTable
public DatabaseTable(String sql, String conn, boolean allowWrites)(Code)
Create a new database table wrapper
Parameters:
  sql - the SQL query for the table
Parameters:
  conn - the connection name
Parameters:
  allowWrites - true if the result set is to be updatable



DatabaseTable
public DatabaseTable(String tableName, String fields, String where, String conn, boolean allowWrites)(Code)
Create a new database table wrapper
Parameters:
  tableName - the table name
Parameters:
  fields - the fields to retrieve
Parameters:
  where - the where clause to use in the query
Parameters:
  conn - the connection name
Parameters:
  allowWrites - true if the result set is to be updatable




Method Detail
cacheData
protected void cacheData()(Code)



executeUpdate
public int executeUpdate(String sql) throws Exception(Code)
Execute an update statement
Parameters:
  sql - the UPDATE SQL statement
throws:
  Exception -



finalize
protected void finalize() throws Throwable(Code)



first
public void first()(Code)



getConnName
public String getConnName()(Code)
Get the connection name the connection names



getCurrentRow
public int getCurrentRow()(Code)
Gets the current row. the new row index - 0 based



getFieldIndex
public int getFieldIndex(String fieldName)(Code)
Get the index (zero based) of a named field
Parameters:
  fieldName - the field name the index



getFieldName
public String getFieldName(int fieldIdx)(Code)
Get the name of a field
Parameters:
  fieldIdx - the field index (zero based) the index



getFields
public String getFields()(Code)
Gets the fields used for the query the where clause



getNumFields
public int getNumFields()(Code)
get the number of fields in the table the number of fields



getNumRows
public int getNumRows()(Code)
Get the number of rows/records in the resultset/table



getSQL
public String getSQL(String where)(Code)
Get the SQL for the SELECT statement or return the SQL that was specified
Parameters:
  where - the where clause if any the SQL statement



getTableName
public String getTableName()(Code)
Gets the table name the table name



getTableName
public void getTableName(String name)(Code)
Get the table name
Parameters:
  name - the table name



getValue
public String getValue(int fieldIdx)(Code)
Get a field value
Parameters:
  fieldIdx - the (zero based) field index the value



getValue
public String getValue(int rowIdx, int fieldIdx)(Code)
Get a field value
Parameters:
  rowIdx - the (zero based) row index
Parameters:
  fieldIdx - the (zero based) field/column index



getWhereClause
public String getWhereClause()(Code)
Gets the value of any where clause the where clause



isDistinct
public boolean isDistinct()(Code)
Check if the table is set to retrieve distinct rows the distinct flag



last
public void last()(Code)



next
public boolean next()(Code)



previous
public boolean previous()(Code)



retrieve
public void retrieve()(Code)
Retrieve values using the deafult where clause



retrieve
public void retrieve(String where)(Code)
Retrieve values using the specified where clause. If a SQL statement has been specified in its entirety then the where clause argument is ignored.
Parameters:
  where - the SQL where statement (without the WHERE)



setCaseSensitive
public static void setCaseSensitive(boolean state)(Code)
Set the case sensitivity for database comparisons. This setting is application wide
Parameters:
  state - true for case-sensitive comparisons of field names



setCurrentRow
public void setCurrentRow(int idx)(Code)
Sets the current row.
Parameters:
  idx - the new row index - 0 based



setDistinct
public void setDistinct(boolean isDistinct)(Code)
Set the table to retrieve distinct rows



setOrderField
public void setOrderField(String fld)(Code)
Set the field name(s) for the ORDER clause
Parameters:
  fld -



setValue
public void setValue(int rowIdx, int fieldIdx, String value)(Code)
Set a field value
Parameters:
  rowIdx - the (zero based) row index
Parameters:
  fieldIdx - the (zero based) field/column index
Parameters:
  the - new field value



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.