Awake SQL v1.2.1

org.awakefw.sql.api.util
Class SqlUtil

java.lang.Object
  extended by org.awakefw.sql.api.util.SqlUtil

public class SqlUtil
extends Object

Provides methods to get database product info & other utilities to format SQL statements.

Since:
1.0

Field Summary
static String ADAPTIVE_SERVER_ENTERPRISE
          Constant for defining Sybase Adaptive Server Enterprise product
static String DB2
          Constant for defining DB2 product
static String H2
          Constant for defining H2
static String HSQLDB
          Constant for defining HyperSQL
static String INFORMIX
          Constant for defining Informix
static String INGRES
          Constant for defining INGRES
static String MYSQL
          Constant for defining MySQL product
static String ORACLE
          Constant for defining Oracle product
static String POSTGRESQL
          Constant for defining PostgreSQL product
static String SQL_ANYWHERE
          Constant for defining Sybase SQL Anywhere product
static String SQL_SERVER
          Constant for defining SQL Server product
static String TERADATA
          Constant for defining Teradata
 
Constructor Summary
SqlUtil(Connection connection)
          Constructor.
 
Method Summary
 String getDatabaseProductName()
          Returns the database product name.
 boolean isAdaptiveServerEnterprise()
          Returns true if the database engine is Adaptive Server Enterprise.
 boolean isDB2()
          Returns true if the database engine is DB2.
 boolean isH2()
          Returns true if the database engine is HSQLDB (HyperSQL Database).
 boolean isHSQLDB()
          Returns true if the database engine is HSQLDB (HyperSQL Database).
 boolean isInformix()
          Returns true if the database engine is Informix.
 boolean isIngres()
          Returns true if the database engine is Ingres.
 boolean isMySQL()
          Returns true if the database engine is MySQL.
 boolean isOracle()
          Returns true if the database engine is Oracle Database.
 boolean isPostgreSQL()
          Returns true if the database engine is PostgreSQL.
 boolean isSQLAnywhere()
          Returns true if the database engine is SQL Anywhere.
 boolean isSQLServer()
          Returns true if the database engine is SQL Server.
 boolean isTeradata()
          Returns true if the database engine is SQL Server.
static String listToSqlList(List<?> objects)
          Transforms a List into a SQL 'IN(..., ...)' of objects separated with commas.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADAPTIVE_SERVER_ENTERPRISE

public static final String ADAPTIVE_SERVER_ENTERPRISE
Constant for defining Sybase Adaptive Server Enterprise product

See Also:
Constant Field Values

DB2

public static final String DB2
Constant for defining DB2 product

See Also:
Constant Field Values

H2

public static final String H2
Constant for defining H2

See Also:
Constant Field Values

HSQLDB

public static final String HSQLDB
Constant for defining HyperSQL

See Also:
Constant Field Values

INFORMIX

public static final String INFORMIX
Constant for defining Informix

See Also:
Constant Field Values

INGRES

public static final String INGRES
Constant for defining INGRES

See Also:
Constant Field Values

MYSQL

public static final String MYSQL
Constant for defining MySQL product

See Also:
Constant Field Values

ORACLE

public static final String ORACLE
Constant for defining Oracle product

See Also:
Constant Field Values

POSTGRESQL

public static final String POSTGRESQL
Constant for defining PostgreSQL product

See Also:
Constant Field Values

SQL_ANYWHERE

public static final String SQL_ANYWHERE
Constant for defining Sybase SQL Anywhere product

See Also:
Constant Field Values

SQL_SERVER

public static final String SQL_SERVER
Constant for defining SQL Server product

See Also:
Constant Field Values

TERADATA

public static final String TERADATA
Constant for defining Teradata

See Also:
Constant Field Values
Constructor Detail

SqlUtil

public SqlUtil(Connection connection)
        throws SQLException
Constructor.

Parameters:
connection - the JDBC Connection
Throws:
SQLException
Method Detail

getDatabaseProductName

public String getDatabaseProductName()
Returns the database product name.

Returns:
the database product name

isAdaptiveServerEnterprise

public boolean isAdaptiveServerEnterprise()
Returns true if the database engine is Adaptive Server Enterprise.

Returns:
true if the database engine is Adaptive Server Enterprise

isDB2

public boolean isDB2()
Returns true if the database engine is DB2.

Returns:
true if the database engine is DB2

isH2

public boolean isH2()
Returns true if the database engine is HSQLDB (HyperSQL Database).

Returns:
true if the database engine is HSQLDB (HyperSQL Database)

isHSQLDB

public boolean isHSQLDB()
Returns true if the database engine is HSQLDB (HyperSQL Database).

Returns:
true if the database engine is HSQLDB (HyperSQL Database)

isInformix

public boolean isInformix()
Returns true if the database engine is Informix.

Returns:
true if the database engine is Informix

isIngres

public boolean isIngres()
Returns true if the database engine is Ingres.

Returns:
true if the database engine is Informix

isMySQL

public boolean isMySQL()
Returns true if the database engine is MySQL.

Returns:
true if the database engine is MySQL

isOracle

public boolean isOracle()
Returns true if the database engine is Oracle Database.

Returns:
true if the database engine is Oracle Database

isPostgreSQL

public boolean isPostgreSQL()
Returns true if the database engine is PostgreSQL.

Returns:
true if the database engine is PostgreSQL

isSQLAnywhere

public boolean isSQLAnywhere()
Returns true if the database engine is SQL Anywhere.

Returns:
true if the database engine is SQL Anywhere

isSQLServer

public boolean isSQLServer()
Returns true if the database engine is SQL Server.

Returns:
true if the database engine is SQL Server

isTeradata

public boolean isTeradata()
Returns true if the database engine is SQL Server.

Returns:
true if the database engine is SQL Server

listToSqlList

public static String listToSqlList(List<?> objects)
Transforms a List into a SQL 'IN(..., ...)' of objects separated with commas.

Parameters:
objects - the List of objects
Returns:
String of objects separated by commas for SQL 'IN(..., ...)' format.

Awake SQL v1.2.1

Awake SQL - Virtual JDBC Driver over HTTP for Android, Swing and JavaFX
Android & Desktop Edition allow easy access to majors remote SQL databases with regular JDBC calls:
DB2 - H2 - HSQLDB (HyperSQL) - Informix - Ingres - MySQL - Oracle - PostgreSQL - SQL Server - Sybase - Teradata
Copyright © 2012 Kawan Softwares SAS