Java Doc for Database.java in  » J2EE » fleXive » com » flexive » core » 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 » J2EE » fleXive » com.flexive.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.core.Database

Database
final public class Database (Code)
Class handling Database stuff
author:
   Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
author:
   Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)


Field Summary
final public static  intMAX_DIVISIONS
    


Method Summary
public static  voidcloseObjects(Class caller, Connection con, Statement stmt)
     Helper function to close connections and statements.
public static  voidcloseObjects(String caller, Connection con, Statement stmt)
     Helper function to close connections and statements.
public static  DataSourcegetDataSource()
     Returns the data source for the calling user's division.
public static  DataSourcegetDataSource(int divisionId)
     Retrieves a database connection.
public static  ConnectiongetDbConnection(int divisionId)
     Retrieves a database connection.
public static  ConnectiongetDbConnection()
     Return a database connection for the current user's division.
public static  DivisionDatagetDivisionData()
    
public static synchronized  DataSourcegetGlobalDataSource()
     Retrieve data source for global configuration table, regardless of the current request's division id.
public static  ConnectiongetGlobalDbConnection()
     Retrieves a database connection for the global configuration table, regardless of the current request's division id.
public static  booleanisForeignKeyViolation(Exception exc)
     Returns true if the SqlError is a foreign key violation.
public static  booleanisUniqueConstraintViolation(Exception exc)
     Returns true if the SqlError is a unique constraint violation.
public static  FxStringloadContentDataFxString(Connection con, String column, String whereClause)
    
public static  FxStringloadFxString(Connection con, String table, String column, String whereClause)
    
public static  FxString[]loadFxString(Connection con, String table, String[] columns, String whereClause)
    
public static  Map<Long, FxString[]>loadFxStrings(Connection con, String table, String[] columns)
     Loads all FxString entries stored in the given table.
public static  voidstoreFxString(FxString string, Connection con, String table, String dataColumn, String idColumn, long id)
    
public static  voidstoreFxString(FxString[] string, Connection con, String table, String[] dataColumn, String idColumn, long id)
    

Field Detail
MAX_DIVISIONS
final public static int MAX_DIVISIONS(Code)
Maximum number of divisions





Method Detail
closeObjects
public static void closeObjects(Class caller, Connection con, Statement stmt)(Code)
Helper function to close connections and statements. A FxDbException is thrown if the close of the connection failed. No Exception is thrown if the Statement failed to close, but a error is logged.
Parameters:
  caller - class calling function/module, or null
Parameters:
  con - the connection to close, or null
Parameters:
  stmt - the statement to close, or null



closeObjects
public static void closeObjects(String caller, Connection con, Statement stmt)(Code)
Helper function to close connections and statements. A FxDbException is thrown if the close of the connection failed. No Exception is thrown if the Statement failed to close, but a error is logged.
Parameters:
  caller - a string representing the calling function/module, or null
Parameters:
  con - the connection to close, or null
Parameters:
  stmt - the statement to close, or null



getDataSource
public static DataSource getDataSource() throws SQLException(Code)
Returns the data source for the calling user's division. the data source for the calling user's division
throws:
  SQLException - if a DB error occured



getDataSource
public static DataSource getDataSource(int divisionId) throws SQLException(Code)
Retrieves a database connection.
Parameters:
  divisionId - the division id a database connection
throws:
  SQLException - If no connection could be retrieved



getDbConnection
public static Connection getDbConnection(int divisionId) throws SQLException(Code)
Retrieves a database connection.
Parameters:
  divisionId - the requested division Id a database connection
throws:
  SQLException - If no connection could be retrieved



getDbConnection
public static Connection getDbConnection() throws SQLException(Code)
Return a database connection for the current user's division. a database connection for the current user's division.
throws:
  SQLException - if a DB error occured



getDivisionData
public static DivisionData getDivisionData() throws SQLException(Code)
Retrieves DivisionData for current division DivisionData
throws:
  SQLException - If no DivisionData could be retrieved



getGlobalDataSource
public static synchronized DataSource getGlobalDataSource() throws SQLException(Code)
Retrieve data source for global configuration table, regardless of the current request's division id. a database connection
throws:
  SQLException - if no connection could be retrieved



getGlobalDbConnection
public static Connection getGlobalDbConnection() throws SQLException(Code)
Retrieves a database connection for the global configuration table, regardless of the current request's division id. a database connection
throws:
  SQLException - if no connection could be retrieved



isForeignKeyViolation
public static boolean isForeignKeyViolation(Exception exc)(Code)
Returns true if the SqlError is a foreign key violation.
Parameters:
  exc - the exception true if the SqlError is a foreign key violation



isUniqueConstraintViolation
public static boolean isUniqueConstraintViolation(Exception exc)(Code)
Returns true if the SqlError is a unique constraint violation.
Parameters:
  exc - the exception true if the SqlError is a unique constraint violation



loadContentDataFxString
public static FxString loadContentDataFxString(Connection con, String column, String whereClause) throws SQLException(Code)
Load a FxString from the content data
Parameters:
  con - an open connection
Parameters:
  column - the name of the column from the translations table to load
Parameters:
  whereClause - mandatory where clause FxString created from the data table
throws:
  SQLException - if a database error occured



loadFxString
public static FxString loadFxString(Connection con, String table, String column, String whereClause) throws SQLException(Code)
Load a FxString from a translation table
Parameters:
  con - an open connection
Parameters:
  table - the base table (NOT the one with translations!)
Parameters:
  column - the name of the columns from the translations table to load
Parameters:
  whereClause - mandatory where clause FxString created from the data table
throws:
  SQLException - if a database error occured



loadFxString
public static FxString[] loadFxString(Connection con, String table, String[] columns, String whereClause) throws SQLException(Code)
Load an FxString array from multiple fields
Parameters:
  con - open and valid connection
Parameters:
  table - table to use
Parameters:
  columns - names of the columns containing the translations
Parameters:
  whereClause - where clause for the table (like id=x) FxString array a string array representing columns
throws:
  SQLException - if a database error occured



loadFxStrings
public static Map<Long, FxString[]> loadFxStrings(Connection con, String table, String[] columns) throws SQLException(Code)
Loads all FxString entries stored in the given table.
Parameters:
  con - an existing connection
Parameters:
  table - table to use
Parameters:
  columns - name of the columns containing the translations all FxString entries stored in the given table, indexed by the ID field.
throws:
  SQLException - if the query was not successful



storeFxString
public static void storeFxString(FxString string, Connection con, String table, String dataColumn, String idColumn, long id) throws SQLException(Code)
Store a FxString in a translation table that only consists of one(!) translation column
Parameters:
  string - string to be stored
Parameters:
  con - existing connection
Parameters:
  table - storage table
Parameters:
  dataColumn - name of the data column
Parameters:
  idColumn - name of the id column
Parameters:
  id - id of the given string
throws:
  SQLException - if a database error occured



storeFxString
public static void storeFxString(FxString[] string, Connection con, String table, String[] dataColumn, String idColumn, long id) throws SQLException(Code)
Store a FxString in a translation table that only consists of n translation columns
Parameters:
  string - string to be stored
Parameters:
  con - existing connection
Parameters:
  table - storage table
Parameters:
  dataColumn - names of the data columns
Parameters:
  idColumn - name of the id column
Parameters:
  id - id of the given string
throws:
  SQLException - if a database error occured



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.