Java Doc for Database.java in  » Database-ORM » Velosurf » velosurf » 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 ORM » Velosurf » velosurf.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   velosurf.sql.Database

Database
public class Database (Code)
This class encapsulates a connection to the database and contains all the stuff relative to it.

To get a new instance, client classes should call one of the getInstance static methods.


author:
   Claude Brisson


Field Summary
final public static  intCASE_SENSITIVE
     sensitive case-sensitive policy.
final public static  intCASE_UNKNOWN
     unknown case-sensitive policy.
final public static  intLOWERCASE
     lowercase case-sensitive policy.
final public static  intUPPERCASE
     uppercase case-sensitive policy.


Method Summary
public  StringadaptCase(String identifier)
     Changes to lowercase or uppercase if needed.
public static  StringadaptContextCase(String str)
     adapt a string to the context case.
public  voidaddEntity(Entity entity)
     Add a new entity.
public  voidclose()
     Close the connection.
public  Stringdeobfuscate(Object value)
     De-obfuscate the given value.
public  voiddisplayStats()
     Display statistics about the statements pools.
public  Objectevaluate(String query)
     Evaluate a query to a scalar.
public  ActiongetAction(String name)
     Get a root action.
public  AttributegetAttribute(String name)
     Get a root attribute.
public  intgetCaseSensivity()
     Get database case-sensivity policy.
public  ConnectionWrappergetConnection()
     Get a jdbc connection.
public  DriverInfogetDriverInfo()
     Get database driver infos.
public  Map<String, Entity>getEntities()
     Entities map getter.
public  EntitygetEntity(String name)
     Get an existing entity.
public  EntitygetEntityCreate(String name)
    
public static  DatabasegetInstance(String user, String password, String url)
     Get a unique Database from connection params.
public static  DatabasegetInstance(String user, String password, String url, String driver)
     Get a unique Database from connection params.
public static  DatabasegetInstance(String user, String password, String url, String driver, String schema)
     Get a unique Database from connection params.
public static  DatabasegetInstance(String configFilename)
     Get a unique Database from config filename.
public static  DatabasegetInstance(InputStream config)
     Get a new connection.
public static  DatabasegetInstance(InputStream config, XIncludeResolver xincludeResolver)
     Get a new connection.
public  ReverseEngineergetReverseEngineer()
     Get reverse engineer.
public  EntitygetRootEntity()
     Get root entity.
public  StringgetSchema()
     Get the schema.
public synchronized  ConnectionWrappergetTransactionConnection()
     Get the underlying jdbc connection used for transactions, and mark it right away as busy.
public  UserContextgetUserContext()
    
protected  voidinitCryptograph()
     Init cryptograph.
protected  voidloadDriver()
     Load the appropriate driver.
public  Stringobfuscate(Object value)
     Obfuscate the given value.
public  PooledPreparedStatementprepare(String query)
     Prepare a query.
public  RowIteratorquery(String query)
     Issue a query.
public  RowIteratorquery(String query, Entity entity)
     Issue a query, knowing the resulting entity.
public  voidsetCaching(int cachingMethod)
     Set the caching method.
public  voidsetCase(int caseSensivity)
     Set the case policy.
public  voidsetDriver(String driverClass)
     Set driver class.
public  voidsetError(String errormsg)
    
public  voidsetMaxConnections(int maxConnections)
     Set the maximum number of connections.
public  voidsetMinConnections(int minConnections)
     Set minimum number of connections.
public  voidsetPassword(String password)
     Set the database password.
public  voidsetReadOnly(boolean readOnly)
     Set the read-only state.
public  voidsetSchema(String schema)
     Set schema name.
public  voidsetSeed(String seed)
     Set the encryption seed.
public  voidsetURL(String url)
     Set the database URL.
public  voidsetUser(String user)
     Set the database user.
public  voidsetUserContext(UserContext userContext)
    
public  PooledPreparedStatementtransactionPrepare(String query)
     Prepare a query which is part of a transaction.
public  inttransactionUpdate(String query)
     Issue an update query that is part of a transaction.
public  intupdate(String query)
     Issue an update query.

Field Detail
CASE_SENSITIVE
final public static int CASE_SENSITIVE(Code)
sensitive case-sensitive policy.



CASE_UNKNOWN
final public static int CASE_UNKNOWN(Code)
unknown case-sensitive policy.



LOWERCASE
final public static int LOWERCASE(Code)
lowercase case-sensitive policy.



UPPERCASE
final public static int UPPERCASE(Code)
uppercase case-sensitive policy.





Method Detail
adaptCase
public String adaptCase(String identifier)(Code)
Changes to lowercase or uppercase if needed.
Parameters:
  identifier - changed identifier



adaptContextCase
public static String adaptContextCase(String str)(Code)
adapt a string to the context case.
Parameters:
  str - string to adapt adapted string



addEntity
public void addEntity(Entity entity)(Code)
Add a new entity.
Parameters:
  entity - entity to add



close
public void close() throws SQLException(Code)
Close the connection.
exception:
  SQLException - thrown by the database engine



deobfuscate
public String deobfuscate(Object value)(Code)
De-obfuscate the given value.
Parameters:
  value - value to de-obfuscate obfuscated value



displayStats
public void displayStats()(Code)
Display statistics about the statements pools.



evaluate
public Object evaluate(String query)(Code)
Evaluate a query to a scalar.
Parameters:
  query - an sql query the resulting scalar



getAction
public Action getAction(String name)(Code)
Get a root action.
Parameters:
  name - name of an attribute the named attribute



getAttribute
public Attribute getAttribute(String name)(Code)
Get a root attribute.
Parameters:
  name - name of an attribute the named attribute



getCaseSensivity
public int getCaseSensivity()(Code)
Get database case-sensivity policy. case-sensivity



getConnection
public ConnectionWrapper getConnection() throws SQLException(Code)
Get a jdbc connection. a jdbc connection wrapper (which extends java.sql.Connection)



getDriverInfo
public DriverInfo getDriverInfo()(Code)
Get database driver infos. the database vendor



getEntities
public Map<String, Entity> getEntities()(Code)
Entities map getter. entities map



getEntity
public Entity getEntity(String name)(Code)
Get an existing entity.
Parameters:
  name - the name of an entity the named entity



getEntityCreate
public Entity getEntityCreate(String name)(Code)
Get a named entity or creeate it if it doesn't exist
Parameters:
  name - name of an entity the named entity



getInstance
public static Database getInstance(String user, String password, String url) throws SQLException(Code)
Get a unique Database from connection params.
Parameters:
  user - user name
Parameters:
  password - password
Parameters:
  url - database url
exception:
  SQLException - thrown by the database engine a new connection



getInstance
public static Database getInstance(String user, String password, String url, String driver) throws SQLException(Code)
Get a unique Database from connection params.
Parameters:
  user - user name
Parameters:
  password - password
Parameters:
  url - database url
Parameters:
  driver - driver java class name
exception:
  SQLException - thrown by the database engine a new connection



getInstance
public static Database getInstance(String user, String password, String url, String driver, String schema) throws SQLException(Code)
Get a unique Database from connection params.
Parameters:
  user - user name
Parameters:
  password - password
Parameters:
  url - database url
Parameters:
  driver - driver java class name
Parameters:
  schema - schema
exception:
  SQLException - thrown by the database engine a new connection



getInstance
public static Database getInstance(String configFilename) throws SQLException, FileNotFoundException, IOException(Code)
Get a unique Database from config filename.
Parameters:
  configFilename - config filename
exception:
  SQLException - thrown by the database engine a new connection



getInstance
public static Database getInstance(InputStream config) throws SQLException(Code)
Get a new connection.
Parameters:
  config - config filename
exception:
  SQLException - thrown by the database engine a new connection



getInstance
public static Database getInstance(InputStream config, XIncludeResolver xincludeResolver) throws SQLException(Code)
Get a new connection.
Parameters:
  config - config filename
exception:
  SQLException - thrown by the database engine a new connection



getReverseEngineer
public ReverseEngineer getReverseEngineer()(Code)
Get reverse engineer. reverse engineer.



getRootEntity
public Entity getRootEntity()(Code)
Get root entity. root entity



getSchema
public String getSchema()(Code)
Get the schema. the schema



getTransactionConnection
public synchronized ConnectionWrapper getTransactionConnection() throws SQLException(Code)
Get the underlying jdbc connection used for transactions, and mark it right away as busy. a jdbc connection wrapper (which extends java.sql.Connection)



getUserContext
public UserContext getUserContext()(Code)
Get this database user context (thread local) the thread local user context



initCryptograph
protected void initCryptograph()(Code)
Init cryptograph.



loadDriver
protected void loadDriver()(Code)
Load the appropriate driver.



obfuscate
public String obfuscate(Object value)(Code)
Obfuscate the given value.
Parameters:
  value - value to obfuscate obfuscated value



prepare
public PooledPreparedStatement prepare(String query)(Code)
Prepare a query.
Parameters:
  query - an sql query the pooled prepared statement corresponding to the query



query
public RowIterator query(String query) throws SQLException(Code)
Issue a query.
Parameters:
  query - an SQL query the resulting RowIterator



query
public RowIterator query(String query, Entity entity) throws SQLException(Code)
Issue a query, knowing the resulting entity.
Parameters:
  query - an SQL query
Parameters:
  entity - the resulting entity return the resulting row iterator



setCaching
public void setCaching(int cachingMethod)(Code)
Set the caching method.
Parameters:
  cachingMethod - caching method



setCase
public void setCase(int caseSensivity)(Code)
Set the case policy. Possible values are CASE_SENSITIVE, CASE_LOWERCASE and CASE_UPPERCASE.
Parameters:
  caseSensivity - case policy



setDriver
public void setDriver(String driverClass)(Code)
Set driver class.
Parameters:
  driverClass - driver class



setError
public void setError(String errormsg)(Code)



setMaxConnections
public void setMaxConnections(int maxConnections)(Code)
Set the maximum number of connections.
Parameters:
  maxConnections - maximum number of connections



setMinConnections
public void setMinConnections(int minConnections)(Code)
Set minimum number of connections.
Parameters:
  minConnections - minimum number of connections



setPassword
public void setPassword(String password)(Code)
Set the database password.
Parameters:
  password - password



setReadOnly
public void setReadOnly(boolean readOnly)(Code)
Set the read-only state.
Parameters:
  readOnly - read-only state



setSchema
public void setSchema(String schema)(Code)
Set schema name.
Parameters:
  schema - schema name



setSeed
public void setSeed(String seed)(Code)
Set the encryption seed.
Parameters:
  seed - encryption seed



setURL
public void setURL(String url)(Code)
Set the database URL.
Parameters:
  url - database url



setUser
public void setUser(String user)(Code)
Set the database user.
Parameters:
  user - user name.



setUserContext
public void setUserContext(UserContext userContext)(Code)
Set this database user context (thread local)
Parameters:
  userContext - user context



transactionPrepare
public PooledPreparedStatement transactionPrepare(String query)(Code)
Prepare a query which is part of a transaction.
Parameters:
  query - an sql query the prepared statemenet corresponding to the query



transactionUpdate
public int transactionUpdate(String query)(Code)
Issue an update query that is part of a transaction.
Parameters:
  query - an sql query the number of affected rows



update
public int update(String query)(Code)
Issue an update query.
Parameters:
  query - an sql query the number of affected rows



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.