Java Doc for Database.java in  » Report » datavision-1.1.0 » jimm » datavision » source » 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 » Report » datavision 1.1.0 » jimm.datavision.source.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jimm.datavision.source.DataSource
      jimm.datavision.source.sql.Database

All known Subclasses:   jimm.datavision.source.sql.SubreportDatabase,
Database
public class Database extends DataSource (Code)
A database knows about the tables in a database.
author:
   Jim Menard, jimm@io.com


Field Summary
final protected static  String[]DB_OBJECT_TYPES
    
protected  Connectionconn
    
protected  StringconnInfo
    
protected  booleanconnectionOwnedByMe
    
protected  StringdriverClassName
    
protected  booleanhasPassword
    
protected  Stringname
    
protected  StringschemaName
    
protected  booleanstoresLowerCaseIdentifiers
    
protected  booleanstoresUpperCaseIdentifiers
    
protected  HashMaptableCacheMap
    
protected  TreeMaptables
    
protected  Stringusername
    

Constructor Summary
public  Database(Connection conn, Report report)
    
public  Database(String driverClassName, String connInfo, Report report, String name, String user)
     Constructor.
public  Database(String driverClassName, String connInfo, Report report, String name, String user, String password)
     Constructor.
protected  Database(String driverClassName, String connInfo, Report report, String name, String user, String password, boolean givenPassword)
     Constructor.

Method Summary
public  booleanareRecordsSelectable()
    
public  booleanareRecordsSortable()
    
public  booleancanGroupRecords()
    
public  booleancanJoinTables()
    
public  Iteratorcolumns()
    
protected  voiddoWriteXML(XMLWriter out)
     Writes this database and all its tables as an XML tag.
public  DataCursorexecute()
    
public  ColumnfindColumn(Object id)
     Given an id (a column name), returns the column that has that id.
protected  TablefindTable(String tableName)
     Given a table name, find the table.
protected  TablefindTableWithId(String id)
     Finds table with given id string.
public  ConnectiongetConnection()
     Returns a connection to the database.
public  StringgetConnectionInfo()
     Returns the connection info string.
public  StringgetDriverClassName()
     Returns the driver class name.
public  StringgetName()
     Returns the database name.
public  StringgetPassword()
     Returns the password.
public  StringgetUserName()
     Returns the user name.
public  voidinitializeConnection()
     Initializes the connection to the database.
public  booleanisConnectionEditable()
    
public  booleanisSQLGenerated()
    
protected  voidloadAllTables()
     Loads information about all tables in the database.
protected  voidloadTablesUsingSchemaNameAndTypes(DatabaseMetaData dbmd, String schema, String[] objectTypes)
     Loads our list of tables using a database meta data object and a schema name.
public  voidreset(String driverClassName, String connInfo, String dbName, String username, String password)
     Reset key instance variables, closes current connection, and "reloads" all table information (compares new info with existing info and complains if any existing info is not in the new info).

Note: if the connection we currently have was created by this object, we close it.

protected  voidsetConnectionInfo(String newConnectionInfo)
     Sets the connection info string.
protected  voidsetDriverClassName(String newDriverClassName)
     Sets the driver class name.
protected  voidsetName(String newName)
     Sets the name.
public  voidsetPassword(String newPassword)
     Sets the password.
public  voidsetUserName(String newUserName)
     Sets the user name.
public  booleanstoresLowerCaseIdentifiers()
    
public  booleanstoresUpperCaseIdentifiers()
    
public  Iteratortables()
    
public  IteratortablesUsedInReport()
    

Field Detail
DB_OBJECT_TYPES
final protected static String[] DB_OBJECT_TYPES(Code)



conn
protected Connection conn(Code)



connInfo
protected String connInfo(Code)



connectionOwnedByMe
protected boolean connectionOwnedByMe(Code)



driverClassName
protected String driverClassName(Code)



hasPassword
protected boolean hasPassword(Code)



name
protected String name(Code)



schemaName
protected String schemaName(Code)



storesLowerCaseIdentifiers
protected boolean storesLowerCaseIdentifiers(Code)



storesUpperCaseIdentifiers
protected boolean storesUpperCaseIdentifiers(Code)



tableCacheMap
protected HashMap tableCacheMap(Code)



tables
protected TreeMap tables(Code)



username
protected String username(Code)




Constructor Detail
Database
public Database(Connection conn, Report report) throws SQLException(Code)



Database
public Database(String driverClassName, String connInfo, Report report, String name, String user) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, UserCancellationException(Code)
Constructor.
Parameters:
  driverClassName - database driver class name
Parameters:
  connInfo - database connection info string
Parameters:
  report - the report using this database
Parameters:
  name - the database name
Parameters:
  user - the user name to use when logging in to the database



Database
public Database(String driverClassName, String connInfo, Report report, String name, String user, String password) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, UserCancellationException(Code)
Constructor.
Parameters:
  driverClassName - database driver class name
Parameters:
  connInfo - database connection info string
Parameters:
  report - the report using this database
Parameters:
  name - the database name
Parameters:
  user - the user name to use when logging in to the database
Parameters:
  password - the database password



Database
protected Database(String driverClassName, String connInfo, Report report, String name, String user, String password, boolean givenPassword) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, UserCancellationException(Code)
Constructor.
Parameters:
  driverClassName - database driver class name
Parameters:
  connInfo - database connection info string
Parameters:
  report - the report using this database
Parameters:
  name - the database name
Parameters:
  user - the user name to use when logging in to the database
Parameters:
  password - the database password
Parameters:
  givenPassword - if true, the password was passed into some other constructor




Method Detail
areRecordsSelectable
public boolean areRecordsSelectable()(Code)



areRecordsSortable
public boolean areRecordsSortable()(Code)



canGroupRecords
public boolean canGroupRecords()(Code)



canJoinTables
public boolean canJoinTables()(Code)



columns
public Iterator columns()(Code)



doWriteXML
protected void doWriteXML(XMLWriter out)(Code)
Writes this database and all its tables as an XML tag.
Parameters:
  out - a writer that knows how to write XML



execute
public DataCursor execute() throws SQLException(Code)



findColumn
public Column findColumn(Object id)(Code)
Given an id (a column name), returns the column that has that id. If no column with the specified id exists, returns null. Uses Table.findColumn.
Parameters:
  id - a column id a column, or null if no column with the specifiedid exists
See Also:   Table.findColumn



findTable
protected Table findTable(String tableName)(Code)
Given a table name, find the table. The table name may have a schema name or not. We look for the table first using tableName as-is, then we use this database's schema name, then we try no schema name at all.
Parameters:
  tableName - a table name, perhaps including a schema name.



findTableWithId
protected Table findTableWithId(String id)(Code)
Finds table with given id string. Returns null if it is not found. If the report says that database names are not case-sensitive, then we do a case-insensitive comparison.
Parameters:
  id - a table id; if names are not case-sensitive then idwill be lower-case when it is passed in



getConnection
public Connection getConnection()(Code)
Returns a connection to the database. a connection to the database



getConnectionInfo
public String getConnectionInfo()(Code)
Returns the connection info string. the connection info string



getDriverClassName
public String getDriverClassName()(Code)
Returns the driver class name. the driver class name



getName
public String getName()(Code)
Returns the database name. the database name



getPassword
public String getPassword()(Code)
Returns the password. the password



getUserName
public String getUserName()(Code)
Returns the user name. the user name



initializeConnection
public void initializeConnection() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UserCancellationException(Code)
Initializes the connection to the database.



isConnectionEditable
public boolean isConnectionEditable()(Code)



isSQLGenerated
public boolean isSQLGenerated()(Code)



loadAllTables
protected void loadAllTables() throws SQLException(Code)
Loads information about all tables in the database. If no tables are found when using the database schema name, try again with a null schema name.



loadTablesUsingSchemaNameAndTypes
protected void loadTablesUsingSchemaNameAndTypes(DatabaseMetaData dbmd, String schema, String[] objectTypes) throws SQLException(Code)
Loads our list of tables using a database meta data object and a schema name. The schema name may be null.
Parameters:
  dbmd - the database meta data object
Parameters:
  objectTypes - a list of database object types
Parameters:
  schema - the schema name; may be null



reset
public void reset(String driverClassName, String connInfo, String dbName, String username, String password) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, UserCancellationException(Code)
Reset key instance variables, closes current connection, and "reloads" all table information (compares new info with existing info and complains if any existing info is not in the new info).

Note: if the connection we currently have was created by this object, we close it. If the connection was handed to us, we do not close the connection.
Parameters:
  driverClassName - database driver class name
Parameters:
  connInfo - database connection info string
Parameters:
  dbName - database name
Parameters:
  username - the user name to use when logging in to the database




setConnectionInfo
protected void setConnectionInfo(String newConnectionInfo)(Code)
Sets the connection info string.
Parameters:
  newConnectionInfo - the connection info string



setDriverClassName
protected void setDriverClassName(String newDriverClassName)(Code)
Sets the driver class name.
Parameters:
  newDriverClassName - the driver class name



setName
protected void setName(String newName)(Code)
Sets the name.
Parameters:
  newName - the new name



setPassword
public void setPassword(String newPassword)(Code)
Sets the password.
Parameters:
  newPassword - the new password



setUserName
public void setUserName(String newUserName)(Code)
Sets the user name.
Parameters:
  newUserName - the new user name



storesLowerCaseIdentifiers
public boolean storesLowerCaseIdentifiers()(Code)



storesUpperCaseIdentifiers
public boolean storesUpperCaseIdentifiers()(Code)



tables
public Iterator tables()(Code)



tablesUsedInReport
public Iterator tablesUsedInReport()(Code)



Fields inherited from jimm.datavision.source.DataSource
protected String metadataURL(Code)(Java Doc)
protected Query query(Code)(Java Doc)
protected Report report(Code)(Java Doc)

Methods inherited from jimm.datavision.source.DataSource
public void addColumn(Column col)(Code)(Java Doc)
public boolean alreadyUsedSourceFile()(Code)(Java Doc)
abstract public boolean areRecordsSelectable()(Code)(Java Doc)
abstract public boolean areRecordsSortable()(Code)(Java Doc)
abstract public boolean canGroupRecords()(Code)(Java Doc)
abstract public boolean canJoinTables()(Code)(Java Doc)
public boolean canRunReports()(Code)(Java Doc)
abstract public Iterator columns()(Code)(Java Doc)
public Iterator columnsInTablesUsedInReport()(Code)(Java Doc)
public boolean containsReferenceTo(Parameter p)(Code)(Java Doc)
abstract protected void doWriteXML(XMLWriter out)(Code)(Java Doc)
abstract public DataCursor execute() throws Exception(Code)(Java Doc)
abstract public Column findColumn(Object id)(Code)(Java Doc)
public Query getQuery()(Code)(Java Doc)
public Report getReport()(Code)(Java Doc)
public int indexOfSelectable(Selectable sel)(Code)(Java Doc)
abstract public boolean isConnectionEditable()(Code)(Java Doc)
abstract public boolean isSQLGenerated()(Code)(Java Doc)
public boolean needsSourceFile()(Code)(Java Doc)
public void readMetadataFrom(String urlString) throws Exception(Code)(Java Doc)
public void reloadColumns()(Code)(Java Doc)
public void removeSort(Selectable s)(Code)(Java Doc)
public void reuseSourceFile() throws FileNotFoundException(Code)(Java Doc)
public void setSourceFile(String filePath) throws FileNotFoundException(Code)(Java Doc)
abstract public Iterator tables()(Code)(Java Doc)
abstract public Iterator tablesUsedInReport()(Code)(Java Doc)
public boolean usesSourceFile()(Code)(Java Doc)
public void writeXML(XMLWriter out)(Code)(Java Doc)

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.