|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.sql.SQLUtils
Various sql utility methods
Field Summary | |
private static java.lang.String[] |
listSQLKeyWords
|
Constructor Summary | |
SQLUtils()
|
Method Summary | |
static java.lang.String[] |
getColNames(java.sql.ResultSet result)
Returns a arraylist with the column names |
static java.lang.String[] |
getColNames(ResultSetBean rsb)
MOD-BB 09-01-04 Ajout de cette methode. |
static java.util.ArrayList |
getColumnsNames(java.sql.Connection con,
java.lang.String table)
Get the list of column names of a table |
static int[] |
getColWidth(java.sql.ResultSet result)
Returns a arraylist with the column width. |
static int[] |
getColWidth(ResultSetBean result,
int nbToDisplay)
MOD-BB 08-01-04 Ajout de cette methode. |
static int[] |
getColWidth(java.sql.ResultSet result,
int nbToDisplay)
Returns a arraylist with the column width. |
static java.lang.String |
getCurrentValue(ResultSetBean rsb,
int col_index)
|
static java.lang.String |
getCurrentValue(ResultSetBean rsb,
java.lang.String col_name)
|
static java.lang.String |
getValueAt(ResultSetBean rsb,
int row_index,
int col_index)
Renvoie la valeur de la donnee se trouvant aux index passes en parametre. |
static java.lang.String |
getValueAt(ResultSetBean rsb,
int row_index,
java.lang.String col_name)
Renvoie la valeur de la donnee se trouvant a la ligne passee en parametre. |
static boolean |
isQuery(java.lang.String sqlcmd)
Checks if a command is a possible updating command: Currently, it checks only o the first word of the command. |
static void |
moveBeforeFirst(java.sql.ResultSet result)
Deplacement au debut d'un ResultSet (avant la 1ere ligne) |
static void |
moveBeforeFirst(ResultSetBean rsb)
|
static void |
moveNext(ResultSetBean rsb,
int nbRows)
|
static void |
moveNext(java.sql.ResultSet result,
int nbRows)
Avance dans un ResultSet pour un nombre de lignes donne |
static void |
movePrevious(ResultSetBean rsb,
int nbRows)
|
static void |
movePrevious(java.sql.ResultSet result,
int nbRows)
Retour en arriere dans un ResultSet pour un nombre de lignes donne |
static int |
nbCols(ResultSetBean rsb)
MOD-BB 09-01-04 Ajout de cette methode. |
static int |
nbRows(java.sql.ResultSet result)
Calcul le nombre de lignes renvoyees par l'execution d'une commande SQL |
static int |
nbRows(ResultSetBean rsb)
MOD-BB 09-01-04 Ajout de cette methode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String[] listSQLKeyWords
Constructor Detail |
public SQLUtils()
Method Detail |
public static int[] getColWidth(java.sql.ResultSet result)
result
- ResultSet. It will be used to compute the size.
public static int[] getColWidth(java.sql.ResultSet result, int nbToDisplay)
result
- ResultSet. It will be used to compute the size.nbToDisplay
- number of lines to consider for computing the width
public static int[] getColWidth(ResultSetBean result, int nbToDisplay)
result
- ResultSet. It will be used to compute the size.nbToDisplay
- number of lines to consider for computing the width
public static java.lang.String[] getColNames(java.sql.ResultSet result)
result
- ResultSet used to retrieve the column names
public static boolean isQuery(java.lang.String sqlcmd)
sqlcmd
- SQL command to check
public static java.util.ArrayList getColumnsNames(java.sql.Connection con, java.lang.String table)
con
- Connection objecttable
- table name
public static int nbRows(java.sql.ResultSet result)
result
- objet ResultSet contenant les resultats d'une commande SQL
public static int nbRows(ResultSetBean rsb)
rsb
- ResultSetBean dont on veut le nombre de lignes.
public static int nbCols(ResultSetBean rsb)
rsb
- ResultSetBean dont on veut le nombre de colonnes.
public static java.lang.String[] getColNames(ResultSetBean rsb)
rsb
- ResultSetBean dont on veut le nom des colonnes.
public static java.lang.String getValueAt(ResultSetBean rsb, int row_index, int col_index)
rsb
- ResultSetBean dont on va extraire une donnee.row_index
- Index de la ligne.col_index
- Index de la colonne.
public static java.lang.String getValueAt(ResultSetBean rsb, int row_index, java.lang.String col_name)
rsb
- ResultSetBean dont on va extraire une donnee.row_index
- Index de la ligne.col_name
- NOm de la colonne.
public static java.lang.String getCurrentValue(ResultSetBean rsb, java.lang.String col_name)
public static java.lang.String getCurrentValue(ResultSetBean rsb, int col_index)
public static void movePrevious(java.sql.ResultSet result, int nbRows)
result
- ResulSet dans lequel on veut revenir en arrierenbRows
- nombre de lignes de retour en arriere dans le ResultSetpublic static void moveNext(java.sql.ResultSet result, int nbRows)
result
- ResulSet dans lequel on veut avancernbRows
- nombre de lignes avancee dans le ResultSetpublic static void moveBeforeFirst(java.sql.ResultSet result)
result
- ResulSet dans lequel on veut se placer au debutpublic static void moveBeforeFirst(ResultSetBean rsb)
public static void moveNext(ResultSetBean rsb, int nbRows)
public static void movePrevious(ResultSetBean rsb, int nbRows)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |