|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jsqltool.conn.DbConnectionUtil
Title: JSqlTool Project
Description: Utility Class used to connect to the database and fetch data.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of JSqlTool project. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
| Constructor Summary | |
DbConnectionUtil(javax.swing.JFrame parent,
DbConnection c)
Create a database connection. |
|
| Method Summary | |
java.lang.String |
convertDateToString(java.util.Date date)
|
int |
executeStmt(java.lang.String stmt,
java.util.Vector parameters)
Execute a SQL Script. |
java.sql.Connection |
getConn()
|
javax.swing.table.TableModel |
getCrossReference(java.lang.String tableName)
|
DbConnection |
getDbConnection()
|
int |
getLastQueryIndex(java.lang.String query,
java.util.Vector parameters,
int maxRows)
|
java.util.Hashtable |
getPK(java.lang.String tableName)
|
javax.swing.table.TableModel |
getQuery(java.lang.String query,
java.util.Vector parameters)
|
javax.swing.table.TableModel |
getQuery(java.lang.String query,
java.util.Vector parameters,
int startPos,
int maxRows)
|
java.util.List |
getSchemas()
|
javax.swing.table.TableModel |
getTableColumns(java.lang.String tableName)
|
javax.swing.table.TableModel |
getTableIndexes(java.lang.String tableName)
|
java.util.List |
getTables(java.lang.String schema,
java.lang.String tableType)
|
void |
saveProfile(boolean isEdit)
|
void |
writeBlob(byte[] bytes,
java.sql.PreparedStatement stmt)
Store a byte[] a BLOB field. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DbConnectionUtil(javax.swing.JFrame parent,
DbConnection c)
c - databse connection descriptor| Method Detail |
public java.sql.Connection getConn()
public void saveProfile(boolean isEdit)
public java.util.List getTables(java.lang.String schema,
java.lang.String tableType)
public java.util.List getSchemas()
public javax.swing.table.TableModel getQuery(java.lang.String query,
java.util.Vector parameters)
query - query to execute
public javax.swing.table.TableModel getTableColumns(java.lang.String tableName)
tableName - table name
public java.util.Hashtable getPK(java.lang.String tableName)
tableName - table name used to retrieve its pk
public javax.swing.table.TableModel getTableIndexes(java.lang.String tableName)
tableName - table name used to retrieve its indexes
public javax.swing.table.TableModel getCrossReference(java.lang.String tableName)
tableName - table name used to retrieve its fk
public javax.swing.table.TableModel getQuery(java.lang.String query,
java.util.Vector parameters,
int startPos,
int maxRows)
query - query to executestartPos - first record to readmaxRows - max number of records to read
public int getLastQueryIndex(java.lang.String query,
java.util.Vector parameters,
int maxRows)
query - query to executemaxRows - max number of records to read
public int executeStmt(java.lang.String stmt,
java.util.Vector parameters)
stmt - SQL statement to execute
public DbConnection getDbConnection()
public java.lang.String convertDateToString(java.util.Date date)
public final void writeBlob(byte[] bytes,
java.sql.PreparedStatement stmt)
throws java.lang.Exception
bytes - byte[] to storestmt - statement whose first element is a BLOB field
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||