com.dotmarketing.common.db
Class DotConnect

java.lang.Object
  extended by com.dotmarketing.common.db.DotConnect

public class DotConnect
extends java.lang.Object

Description of the Class

Author:
will

Constructor Summary
DotConnect()
           
 
Method Summary
 void addObject(java.lang.Object x)
           
 void addParam(boolean x)
          Adds a feature to the Param attribute of the dotConnect object
 void addParam(java.util.Date x)
          Adds a date parameter to the prepared SQL statement.
 void addParam(double x)
          Adds a double parameter to the prepared SQL statement.
 void addParam(int x)
          This method adds an int parameter to the prepared SQL statement.
 void addParam(long x)
          Adds a long parameter to the prepared SQL statement.
 void addParam(java.lang.Object x)
           
 void addParam(java.lang.String x)
          This method adds a String parameter to the prepared SQL statement.
static java.lang.String bitAND(java.lang.String op1, java.lang.String op2)
          Returns the correct bit AND operation syntax for a particular RDBMS
static java.lang.String bitNOT(java.lang.String op1)
          Returns the correct bit XOR operation syntax for a particular RDBMS
static java.lang.String bitOR(java.lang.String op1, java.lang.String op2)
          Returns the correct bit OR operation syntax for a particular RDBMS
static java.lang.String bitXOR(java.lang.String op1, java.lang.String op2)
          Returns the correct bit XOR operation syntax for a particular RDBMS
static java.lang.String concat(java.lang.String[] elements)
          Returns the correct Concatenation SQL syntax for a particular RDBMS
 boolean executeStatement(java.lang.String sql)
           
 boolean executeStatement(java.lang.String sql, java.sql.Connection con)
           
 int getInt(java.lang.String x)
           
 int getMaxRows()
           
 int getNumRows()
           
 java.lang.Object getObject(java.lang.Object x)
           
 java.lang.Object getObject(java.lang.String x)
           
 java.lang.Object[] getObjectArray(java.lang.String ObjName)
           
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectResults()
          Deprecated. - loadResults as it doesn't swallow the excpetion.
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectResults(java.lang.String dataSource)
          Returns the object results.
 void getResult()
          Deprecated. - Use loadResult instead as it throws the exception and doesn't swallow it Executes SQL, Pulls a result set, sets the rs and rsmd variables.
 void getResult(java.sql.Connection conn)
           
 void getResult(java.lang.String dataSource)
           
 java.util.ArrayList getResults()
          Deprecated. - loadResults as it doesn't swallow the excpetion.
 java.util.ArrayList getResults(java.lang.String dataSource)
          Returns the results.
 java.lang.String getSQL()
           
 int getStartRow()
          Returns the startRow.
 java.lang.String getString(java.lang.String x)
          Returns a single result as a String.
static int getUniqueID(java.lang.String type)
           
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> loadObjectResults()
          Returns the object results.
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> loadObjectResults(java.sql.Connection conn)
          Returns the object results.
 void loadResult()
           
 void loadResult(java.sql.Connection conn)
           
 java.util.ArrayList loadResults()
          Returns the results.
 java.util.ArrayList loadResults(java.sql.Connection conn)
          Returns the results.
 void setForceQuery(boolean force)
           
 void setMaxRows(int x)
           
 void setMaxRows(java.lang.String x)
           
 void setSQL(java.lang.String x)
           
 void setSQL(java.lang.String x, int limit)
           
 void setStartRow(int startRow)
          Sets the startRow.
 void setStartRow(java.lang.String x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotConnect

public DotConnect()
Method Detail

setForceQuery

public void setForceQuery(boolean force)

getInt

public int getInt(java.lang.String x)

setMaxRows

public void setMaxRows(int x)

setMaxRows

public void setMaxRows(java.lang.String x)

getMaxRows

public int getMaxRows()

getNumRows

public int getNumRows()

getObject

public java.lang.Object getObject(java.lang.String x)

getObject

public java.lang.Object getObject(java.lang.Object x)

getObjectArray

public java.lang.Object[] getObjectArray(java.lang.String ObjName)

getResult

public void getResult(java.lang.String dataSource)

getResult

public void getResult(java.sql.Connection conn)

loadResult

public void loadResult(java.sql.Connection conn)
                throws DotDataException
Throws:
DotDataException

executeStatement

public boolean executeStatement(java.lang.String sql)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

executeStatement

public boolean executeStatement(java.lang.String sql,
                                java.sql.Connection con)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

loadResult

public void loadResult()
                throws DotDataException
Throws:
DotDataException

getResult

public void getResult()
Deprecated. - Use loadResult instead as it throws the exception and doesn't swallow it Executes SQL, Pulls a result set, sets the rs and rsmd variables.


setSQL

public void setSQL(java.lang.String x)

setSQL

public void setSQL(java.lang.String x,
                   int limit)

getSQL

public java.lang.String getSQL()

getString

public java.lang.String getString(java.lang.String x)
Returns a single result as a String.

Parameters:
x - Description of Parameter
Returns:
The string value

getUniqueID

public static int getUniqueID(java.lang.String type)

loadResults

public java.util.ArrayList loadResults(java.sql.Connection conn)
                                throws DotDataException
Returns the results.

Returns:
ArrayList
Throws:
DotDataException

loadResults

public java.util.ArrayList loadResults()
                                throws DotDataException
Returns the results.

Returns:
ArrayList
Throws:
DotDataException

getResults

public java.util.ArrayList getResults()
                               throws DotDataException
Deprecated. - loadResults as it doesn't swallow the excpetion.

Returns the results.

Returns:
ArrayList
Throws:
DotDataException

getResults

public java.util.ArrayList getResults(java.lang.String dataSource)
                               throws DotDataException
Returns the results.

Returns:
ArrayList
Throws:
DotDataException

setStartRow

public void setStartRow(int startRow)
Sets the startRow.

Parameters:
startRow - The startRow to set

setStartRow

public void setStartRow(java.lang.String x)

getStartRow

public int getStartRow()
Returns the startRow.

Returns:
int

addObject

public void addObject(java.lang.Object x)

addParam

public void addParam(java.lang.Object x)

addParam

public void addParam(boolean x)
Adds a feature to the Param attribute of the dotConnect object

Parameters:
x - The feature to be added to the Param attribute

addParam

public void addParam(int x)
This method adds an int parameter to the prepared SQL statement.

Parameters:
x - The feature to be added to the Param attribute

addParam

public void addParam(java.lang.String x)
This method adds a String parameter to the prepared SQL statement.

Parameters:
x - The feature to be added to the Param attribute

addParam

public void addParam(long x)
Adds a long parameter to the prepared SQL statement.

Parameters:
x - The feature to be added to the Param attribute

addParam

public void addParam(double x)
Adds a double parameter to the prepared SQL statement.

Parameters:
x - The feature to be added to the Param attribute

addParam

public void addParam(java.util.Date x)
Adds a date parameter to the prepared SQL statement.

Parameters:
x - The feature to be added to the Param attribute

concat

public static java.lang.String concat(java.lang.String[] elements)
Returns the correct Concatenation SQL syntax for a particular RDBMS

Parameters:
elements -
Returns:
result

bitAND

public static java.lang.String bitAND(java.lang.String op1,
                                      java.lang.String op2)
Returns the correct bit AND operation syntax for a particular RDBMS

Parameters:
elements -
Returns:
result

bitOR

public static java.lang.String bitOR(java.lang.String op1,
                                     java.lang.String op2)
Returns the correct bit OR operation syntax for a particular RDBMS

Parameters:
elements -
Returns:
result

bitXOR

public static java.lang.String bitXOR(java.lang.String op1,
                                      java.lang.String op2)
Returns the correct bit XOR operation syntax for a particular RDBMS

Parameters:
elements -
Returns:
result

bitNOT

public static java.lang.String bitNOT(java.lang.String op1)
Returns the correct bit XOR operation syntax for a particular RDBMS

Parameters:
elements -
Returns:
result

loadObjectResults

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> loadObjectResults(java.sql.Connection conn)
                                                                                   throws DotDataException
Returns the object results.

Returns:
ArrayList
Throws:
DotDataException

loadObjectResults

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> loadObjectResults()
                                                                                   throws DotDataException
Returns the object results.

Returns:
ArrayList
Throws:
DotDataException

getObjectResults

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectResults()
                                                                                  throws DotDataException
Deprecated. - loadResults as it doesn't swallow the excpetion.

Returns the object results.

Returns:
ArrayList
Throws:
DotDataException

getObjectResults

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getObjectResults(java.lang.String dataSource)
                                                                                  throws DotDataException
Returns the object results.

Returns:
ArrayList
Throws:
DotDataException


Copyright © 2013 dotCMS Inc. All Rights Reserved.