Java Doc for DBUtil.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » plugins » dbdiff » util » 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 » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.plugins.dbdiff.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.squirrel_sql.plugins.dbdiff.I18NBaseObject
      net.sourceforge.squirrel_sql.plugins.dbdiff.util.DBUtil

DBUtil
public class DBUtil extends I18NBaseObject (Code)
A utility class for interacting with the database.




Method Summary
public static  voidcloseResultSet(ResultSet rs)
     Closes the specified ResultSet.
public static  voidcloseStatement(Statement stmt)
     Closes the specified Statement.
public static  booleancontainsTable(List<ITableInfo> tableInfos, String table)
    
public static  ResultSetexecuteQuery(ISession session, String sql)
     Executes the specified sql statement on the specified connection and returns the ResultSet.
Parameters:
  con -
Parameters:
  sql -
Parameters:
  mysqlBigResultFix - if true, provides a work-around which is usefulin the case that the connection is to a MySQL database.
public static  StringfixCase(ISession session, String identifier)
     Uppercase / Lowercase / Mixedcase identifiers are a big problem.
public static  StringgetCatSep(ISession session)
    
public static  intgetColumnCount(ISQLConnection sourceConn, ITableInfo ti)
    
public static  StringgetColumnList(TableColumnInfo[] colInfoArr)
    
public static  StringgetColumnName(ISQLConnection sourceConn, ITableInfo ti, int column)
    
public static  String[]getColumnNames(ISQLConnection sourceConn, ITableInfo ti)
    
public static  intgetColumnType(ISQLConnection con, ITableInfo ti, String columnName)
    
public static  intgetColumnType(ISQLConnection con, ITableInfo ti, int column)
    
public static  int[]getColumnTypes(ISQLConnection con, ITableInfo ti, String[] colNames)
    
public static  int[]getColumnTypes(ISQLConnection con, ITableInfo ti)
    
public static  StringgetLastStatement()
    
public static  StringgetLastStatementValues()
    
public static  StringgetMaxColumnLengthSQL(ISession sourceSession, TableColumnInfo colInfo, String tableName, boolean tableNameIsQualified)
     Gets the SQL statement which can be used to select the maximum length of the current data found in tableName within the specified column.
public static  StringgetPKColumnString(ISQLConnection sourceConn, ITableInfo ti)
     Returns a string that looks like: (PK_COL1, PK_COL2, PK_COL3, ...) or null if there is no primary key for the specified table.
public static  StringgetQualifiedObjectName(ISession session, String catalogName, String schemaName, String objectName, int sessionType)
     Decide whether or not the session specified needs fully qualified table names (schema.table).
public static  StringgetSelectQuery(SessionInfoProvider prov, String columnList, ITableInfo ti)
    
public static  intgetTableCount(ISession session, String catalog, String schema, String tableName, int sessionType)
     Returns a count of the records in the specified table.
public static  ITableInfogetTableInfo(ISession session, String schema, String tableName)
    
public static  booleanisBinaryType(TableColumnInfo columnInfo)
     Returns a boolean value indicating whether or not the specified TableColumnInfo represents a database column that holds binary type data.
public static  intreplaceOtherDataType(TableColumnInfo colInfo)
     Takes the specified colInfo, gets the data type to see if it is 1111(OTHER).
public static  booleansameDatabaseType(ISession session1, ISession session2)
    
public static  voidsetLastStatement(String lastStatement)
    
public static  voidsetLastStatementValues(String values)
    
public static  booleantableHasForeignKey(String destCatalog, String destSchema, String destTableName, ForeignKeyInfo fkInfo, SessionInfoProvider prov)
    
public static  booleantableHasPrimaryKey(ISQLConnection con, ITableInfo ti)
    



Method Detail
closeResultSet
public static void closeResultSet(ResultSet rs)(Code)
Closes the specified ResultSet.
Parameters:
  rs - the ResultSet to close.



closeStatement
public static void closeStatement(Statement stmt)(Code)
Closes the specified Statement.
Parameters:
  stmt - the Statement to close.



containsTable
public static boolean containsTable(List<ITableInfo> tableInfos, String table)(Code)



executeQuery
public static ResultSet executeQuery(ISession session, String sql) throws SQLException(Code)
Executes the specified sql statement on the specified connection and returns the ResultSet.
Parameters:
  con -
Parameters:
  sql -
Parameters:
  mysqlBigResultFix - if true, provides a work-around which is usefulin the case that the connection is to a MySQL database. If the number of rows is large this will prevent the driver from readingthem all into client memory. MySQL's normal practice is to do such a thing for performance reasons.
throws:
  Exception -



fixCase
public static String fixCase(ISession session, String identifier)(Code)
Uppercase / Lowercase / Mixedcase identifiers are a big problem. Some databases support mixing case (like McKoi) others force identifier case to all uppercase or all lowercase. Some (like MySQL) can be configured to care or not care about case as well as depending on the platform the database is on. This method attempt to use the metadata from the driver to "fix" the case of the identifier to be acceptable for the specified session.
Parameters:
  session - the session whose disposition on case we care about.
Parameters:
  identifier -



getCatSep
public static String getCatSep(ISession session)(Code)



getColumnCount
public static int getColumnCount(ISQLConnection sourceConn, ITableInfo ti) throws SQLException(Code)

Parameters:
  sourceConn -
Parameters:
  ti -
throws:
  SQLException -



getColumnList
public static String getColumnList(TableColumnInfo[] colInfoArr) throws SQLException(Code)

Parameters:
  con -
Parameters:
  ti -
throws:
  SQLException -



getColumnName
public static String getColumnName(ISQLConnection sourceConn, ITableInfo ti, int column) throws SQLException(Code)

Parameters:
  sourceConn -
Parameters:
  ti -
Parameters:
  column -
throws:
  SQLException -



getColumnNames
public static String[] getColumnNames(ISQLConnection sourceConn, ITableInfo ti) throws SQLException(Code)

Parameters:
  sourceConn -
Parameters:
  ti -
throws:
  SQLException -



getColumnType
public static int getColumnType(ISQLConnection con, ITableInfo ti, String columnName) throws SQLException(Code)

Parameters:
  con -
Parameters:
  synonym -
Parameters:
  columnName -
throws:
  SQLException -



getColumnType
public static int getColumnType(ISQLConnection con, ITableInfo ti, int column) throws SQLException(Code)

Parameters:
  con -
Parameters:
  ti -
Parameters:
  column -
throws:
  SQLException -



getColumnTypes
public static int[] getColumnTypes(ISQLConnection con, ITableInfo ti, String[] colNames) throws SQLException(Code)



getColumnTypes
public static int[] getColumnTypes(ISQLConnection con, ITableInfo ti) throws SQLException(Code)



getLastStatement
public static String getLastStatement()(Code)
the lastStatement



getLastStatementValues
public static String getLastStatementValues()(Code)



getMaxColumnLengthSQL
public static String getMaxColumnLengthSQL(ISession sourceSession, TableColumnInfo colInfo, String tableName, boolean tableNameIsQualified) throws UserCancelledOperationException(Code)
Gets the SQL statement which can be used to select the maximum length of the current data found in tableName within the specified column.
Parameters:
  sourceSession -
Parameters:
  colInfo -
Parameters:
  tableName -
Parameters:
  tableNameIsQualified - TODO



getPKColumnString
public static String getPKColumnString(ISQLConnection sourceConn, ITableInfo ti) throws SQLException(Code)
Returns a string that looks like: (PK_COL1, PK_COL2, PK_COL3, ...) or null if there is no primary key for the specified table.
Parameters:
  sourceConn -
Parameters:
  ti -
throws:
  SQLException -



getQualifiedObjectName
public static String getQualifiedObjectName(ISession session, String catalogName, String schemaName, String objectName, int sessionType) throws UserCancelledOperationException(Code)
Decide whether or not the session specified needs fully qualified table names (schema.table). In most databases this is optional (Oracle). In others it is required (Progress). In still others it must not occur. (Axion, Hypersonic)
Parameters:
  session -
Parameters:
  catalogName -
Parameters:
  schemaName -
Parameters:
  objectName -
throws:
  UserCancelledOperationException -



getSelectQuery
public static String getSelectQuery(SessionInfoProvider prov, String columnList, ITableInfo ti) throws SQLException, UserCancelledOperationException(Code)

Parameters:
  columnList -
Parameters:
  ti -
throws:
  SQLException -



getTableCount
public static int getTableCount(ISession session, String catalog, String schema, String tableName, int sessionType) throws UserCancelledOperationException(Code)
Returns a count of the records in the specified table.
Parameters:
  con - the SQLConnection to use to execute the count query.
Parameters:
  tableName - the name of the table -1 if the table does not exist, otherwise the record count isreturned.



getTableInfo
public static ITableInfo getTableInfo(ISession session, String schema, String tableName) throws SQLException, MappingException, UserCancelledOperationException(Code)



isBinaryType
public static boolean isBinaryType(TableColumnInfo columnInfo)(Code)
Returns a boolean value indicating whether or not the specified TableColumnInfo represents a database column that holds binary type data.
Parameters:
  columnInfo - the TableColumnInfo to examine true if binary; false otherwise.



replaceOtherDataType
public static int replaceOtherDataType(TableColumnInfo colInfo) throws MappingException(Code)
Takes the specified colInfo, gets the data type to see if it is 1111(OTHER). If so then get the type name and try to match a jdbc type with the same name to get it's type code.
Parameters:
  colInfo -
throws:
  MappingException -



sameDatabaseType
public static boolean sameDatabaseType(ISession session1, ISession session2)(Code)



setLastStatement
public static void setLastStatement(String lastStatement)(Code)

Parameters:
  lastStatement - the lastStatement to set



setLastStatementValues
public static void setLastStatementValues(String values)(Code)



tableHasForeignKey
public static boolean tableHasForeignKey(String destCatalog, String destSchema, String destTableName, ForeignKeyInfo fkInfo, SessionInfoProvider prov)(Code)



tableHasPrimaryKey
public static boolean tableHasPrimaryKey(ISQLConnection con, ITableInfo ti) throws SQLException(Code)



Methods inherited from net.sourceforge.squirrel_sql.plugins.dbdiff.I18NBaseObject
protected static String getMessage(String key)(Code)(Java Doc)
protected static String getMessage(String key, Object arg)(Code)(Java Doc)
protected static String getMessage(String key, Object[] args)(Code)(Java Doc)
public static void main(String[] args)(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.