Java Doc for DatabaseDataSource.java in  » Database-Client » prefuse » prefuse » data » io » 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 » Database Client » prefuse » prefuse.data.io.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   prefuse.data.io.sql.DatabaseDataSource

DatabaseDataSource
public class DatabaseDataSource (Code)
Sends queries to a relational database and processes the results, storing the results in prefuse Table instances. This class should not be instantiated directly. To access a database, the ConnectionFactory class should be used to retrieve an appropriate instance of this class.
author:
   jeffrey heer


Field Summary
protected  Connectionm_conn
    
protected  SQLDataHandlerm_handler
    
protected  Statementm_stmt
    

Constructor Summary
 DatabaseDataSource(Connection conn, SQLDataHandler handler)
     Creates a new DatabaseDataSource for reading data from a SQL relational database.

Method Summary
public synchronized  TablegetData(String query)
     Executes a query and returns the results in a Table instance.
public synchronized  TablegetData(String query, String keyField)
     Executes a query and returns the results in a Table instance.
Parameters:
  query - the text SQL query to execute
Parameters:
  keyField - the field to treat as a primary key, ensuring that thisfield is indexed in the resulting table instance.
public synchronized  TablegetData(Table t, String query)
     Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in.
public synchronized  TablegetData(Table t, String query, String keyField)
     Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in.
public synchronized  TablegetData(Table t, String query, String keyField, Object lock)
     Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in.
protected  intgetExistingRow(Table t, ResultSet rset, String keyField)
     See if a retrieved database row is already represented in the given Table.
public  SchemagetSchema(ResultSetMetaData metadata, SQLDataHandler handler)
     Given the metadata for a SQL result set and a data value handler for that result set, returns a corresponding schema for a prefuse table.
public  voidloadData(Table t, String query)
     Asynchronously executes a query and stores the results in the given table instance.
public  voidloadData(Table t, String query, String keyField)
     Asynchronously executes a query and stores the results in the given table instance.
public  voidloadData(Table t, String query, Object lock)
     Asynchronously executes a query and stores the results in the given table instance.
public  voidloadData(Table t, String query, String keyField, Object lock)
     Asynchronously executes a query and stores the results in the given table instance.
public  voidloadData(Table t, String query, String keyField, Object lock, DataSourceWorker.Listener listener)
     Asynchronously executes a query and stores the results in the given table instance.
protected  Tableprocess(Table t, ResultSet rset, String key, Object lock)
     Process the results of a SQL query, putting retrieved data into a Table instance.

Field Detail
m_conn
protected Connection m_conn(Code)



m_handler
protected SQLDataHandler m_handler(Code)



m_stmt
protected Statement m_stmt(Code)




Constructor Detail
DatabaseDataSource
DatabaseDataSource(Connection conn, SQLDataHandler handler)(Code)
Creates a new DatabaseDataSource for reading data from a SQL relational database. This constructor is only package visible and is not intended for use by application level code. Instead, the ConnectionFactory class should be used to create any number of DatabaseDataSource connections.




Method Detail
getData
public synchronized Table getData(String query) throws DataIOException(Code)
Executes a query and returns the results in a Table instance.
Parameters:
  query - the text SQL query to execute a Table of the query results
throws:
  DataIOException - if an error occurs while executing the query or adding the query results in a prefuse Table.



getData
public synchronized Table getData(String query, String keyField) throws DataIOException(Code)
Executes a query and returns the results in a Table instance.
Parameters:
  query - the text SQL query to execute
Parameters:
  keyField - the field to treat as a primary key, ensuring that thisfield is indexed in the resulting table instance. a Table of the query results
throws:
  DataIOException - if an error occurs while executing the query or adding the query results in a prefuse Table.



getData
public synchronized Table getData(Table t, String query) throws DataIOException(Code)
Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in. If this value is null, anew table will automatically be created.
Parameters:
  query - the text SQL query to execute a Table of the query results
throws:
  DataIOException - if an error occurs while executing the query or adding the query results in a prefuse Table.



getData
public synchronized Table getData(Table t, String query, String keyField) throws DataIOException(Code)
Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in. If this value is null, anew table will automatically be created.
Parameters:
  query - the text SQL query to execute
Parameters:
  keyField - used to determine if the row already exists in the table a Table of the query results
throws:
  DataIOException - if an error occurs while executing the query or adding the query results in a prefuse Table.



getData
public synchronized Table getData(Table t, String query, String keyField, Object lock) throws DataIOException(Code)
Executes a query and returns the results in a Table instance.
Parameters:
  t - the Table to store the results in. If this value is null, anew table will automatically be created.
Parameters:
  query - the text SQL query to execute
Parameters:
  keyField - used to determine if the row already exists in the table
Parameters:
  lock - an optional Object to use as a lock when performing dataprocessing. This lock will be synchronized on whenever the Table ismodified. a Table of the query results
throws:
  DataIOException - if an error occurs while executing the query or adding the query results in a prefuse Table.



getExistingRow
protected int getExistingRow(Table t, ResultSet rset, String keyField) throws SQLException(Code)
See if a retrieved database row is already represented in the given Table.
Parameters:
  t - the prefuse Table to check for an existing row
Parameters:
  rset - the ResultSet, set to a particular row, which may ormay not have a matching row in the prefuse Table
Parameters:
  keyField - the key field to look up to check for an existing row the index of the existing row, or -1 if no match is found
throws:
  SQLException -



getSchema
public Schema getSchema(ResultSetMetaData metadata, SQLDataHandler handler) throws SQLException(Code)
Given the metadata for a SQL result set and a data value handler for that result set, returns a corresponding schema for a prefuse table.
Parameters:
  metadata - the SQL result set metadata
Parameters:
  handler - the data value handler the schema determined by the metadata and handler
throws:
  SQLException - if an error occurs accessing the metadata



loadData
public void loadData(Table t, String query)(Code)
Asynchronously executes a query and stores the results in the given table instance. All data processing is done in a separate thread of execution.
Parameters:
  t - the Table in which to store the results
Parameters:
  query - the query to execute



loadData
public void loadData(Table t, String query, String keyField)(Code)
Asynchronously executes a query and stores the results in the given table instance. All data processing is done in a separate thread of execution.
Parameters:
  t - the Table in which to store the results
Parameters:
  query - the query to execute
Parameters:
  keyField - the primary key field, comparisons on this field areperformed to recognize data records already present in the table.



loadData
public void loadData(Table t, String query, Object lock)(Code)
Asynchronously executes a query and stores the results in the given table instance. All data processing is done in a separate thread of execution.
Parameters:
  t - the Table in which to store the results
Parameters:
  query - the query to execute
Parameters:
  lock - an optional Object to use as a lock when performing dataprocessing. This lock will be synchronized on whenever the Table ismodified.



loadData
public void loadData(Table t, String query, String keyField, Object lock)(Code)
Asynchronously executes a query and stores the results in the given table instance. All data processing is done in a separate thread of execution.
Parameters:
  t - the Table in which to store the results
Parameters:
  query - the query to execute
Parameters:
  keyField - the primary key field, comparisons on this field areperformed to recognize data records already present in the table.
Parameters:
  lock - an optional Object to use as a lock when performing dataprocessing. This lock will be synchronized on whenever the Table ismodified.



loadData
public void loadData(Table t, String query, String keyField, Object lock, DataSourceWorker.Listener listener)(Code)
Asynchronously executes a query and stores the results in the given table instance. All data processing is done in a separate thread of execution.
Parameters:
  t - the Table in which to store the results
Parameters:
  query - the query to execute
Parameters:
  keyField - the primary key field, comparisons on this field areperformed to recognize data records already present in the table.A null value will result in no key checking.
Parameters:
  lock - an optional Object to use as a lock when performing dataprocessing. This lock will be synchronized on whenever the Table ismodified. A null value will result in no locking.
Parameters:
  listener - an optional listener that will provide notificationsbefore the query has been issued and after the query has been processed. This is most useful for post-processing operations.



process
protected Table process(Table t, ResultSet rset, String key, Object lock) throws DataIOException(Code)
Process the results of a SQL query, putting retrieved data into a Table instance. If a null table is provided, a new table with the appropriate schema will be created.
Parameters:
  t - the Table to store results in
Parameters:
  rset - the SQL query result set a Table containing the query results



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.