railo.runtime.tag
Class Query

java.lang.Object
  extended by railo.runtime.ext.tag.TagImpl
      extended by railo.runtime.ext.tag.BodyTagImpl
          extended by railo.runtime.ext.tag.BodyTagTryCatchFinallyImpl
              extended by railo.runtime.tag.Query
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public final class Query
extends BodyTagTryCatchFinallyImpl

Passes SQL statements to a data source. Not limited to queries.


Field Summary
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
Query()
           
 
Method Summary
static Object _call(PageContext pc, String hql, Object params, boolean unique, Struct queryOptions)
           
 int doAfterBody()
           
 int doEndTag()
           
 void doFinally()
           
 void doInitBody()
           
 int doStartTag()
           
 String getName()
           
 void release()
           
 void setBlockfactor(double blockfactor)
          set the value blockfactor Specifies the maximum number of rows to fetch at a time from the server.
 void setCachedafter(DateTime cachedafter)
          set the value cachedafter This is the age of which the query data can be
 void setCachedwithin(TimeSpan cachedwithin)
          set the value cachedwithin
 void setCachename(String cachename)
          set the value cachename This is specific to JTags, and allows you to give the cache a specific name
 void setConnectstring(String connectstring)
          set the value connectstring
 void setDatasource(String datasource)
          set the value datasource The name of the data source from which this query should retrieve data.
 void setDbname(String dbname)
          set the value dbname The database name, Sybase System 11 driver and SQLOLEDB provider only.
 void setDbserver(String dbserver)
          set the value dbserver For native database drivers and the SQLOLEDB provider, specifies the name of the database server computer.
 void setDbtype(String dbtype)
          set the value dbtype The database driver type.
 void setDebug(boolean debug)
          set the value debug Used for debugging queries.
 void setLazy(boolean lazy)
           
 void setMaxrows(double maxrows)
          set the value maxrows Specifies the maximum number of rows to return in the record set.
 void setName(String name)
          set the value name The name query.
 void setOrmoptions(Struct ormoptions)
           
 void setParam(SQLItem item)
           
 void setPassword(String password)
          set the value password If specified, password overrides the password value specified in the data source setup.
 void setProvider(String provider)
          set the value provider COM provider, OLE-DB only.
 void setProviderdsn(String providerdsn)
          set the value providerdsn Data source name for the COM provider, OLE-DB only.
 void setPsq(boolean psq)
           
 void setResult(String result)
           
 void setReturntype(String strReturntype)
           
 void setTimeout(double timeout)
          set the value timeout The maximum number of milliseconds for the query to execute before returning an error indicating that the query has timed-out.
 void setTimezone(String timezone)
           
 void setUnique(boolean unique)
           
 void setUsername(String username)
          set the value username If specified, username overrides the username value specified in the data source setup.
 
Methods inherited from class railo.runtime.ext.tag.BodyTagTryCatchFinallyImpl
doCatch
 
Methods inherited from class railo.runtime.ext.tag.BodyTagImpl
setBodyContent
 
Methods inherited from class railo.runtime.ext.tag.TagImpl
getParent, required, required, required, required, setPageContext, setPageContext, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

Query

public Query()
Method Detail

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class BodyTagImpl

setOrmoptions

public void setOrmoptions(Struct ormoptions)

setReturntype

public void setReturntype(String strReturntype)
                   throws ApplicationException
Throws:
ApplicationException

setUnique

public void setUnique(boolean unique)

setResult

public void setResult(String result)
Parameters:
result - the result to set

setPsq

public void setPsq(boolean psq)
Parameters:
psq - set preserver single quote

setPassword

public void setPassword(String password)
set the value password If specified, password overrides the password value specified in the data source setup.

Parameters:
password - value to set

setDatasource

public void setDatasource(String datasource)
                   throws PageException
set the value datasource The name of the data source from which this query should retrieve data.

Parameters:
datasource - value to set
Throws:
PageException

setTimeout

public void setTimeout(double timeout)
set the value timeout The maximum number of milliseconds for the query to execute before returning an error indicating that the query has timed-out. This attribute is not supported by most ODBC drivers. timeout is supported by the SQL Server 6.x or above driver. The minimum and maximum allowable values vary, depending on the driver.

Parameters:
timeout - value to set

setCachedafter

public void setCachedafter(DateTime cachedafter)
set the value cachedafter This is the age of which the query data can be

Parameters:
cachedafter - value to set

setCachename

public void setCachename(String cachename)
set the value cachename This is specific to JTags, and allows you to give the cache a specific name

Parameters:
cachename - value to set

setCachedwithin

public void setCachedwithin(TimeSpan cachedwithin)
set the value cachedwithin

Parameters:
cachedwithin - value to set

setLazy

public void setLazy(boolean lazy)

setProviderdsn

public void setProviderdsn(String providerdsn)
                    throws ApplicationException
set the value providerdsn Data source name for the COM provider, OLE-DB only.

Parameters:
providerdsn - value to set
Throws:
ApplicationException

setConnectstring

public void setConnectstring(String connectstring)
                      throws ApplicationException
set the value connectstring

Parameters:
connectstring - value to set
Throws:
ApplicationException

setTimezone

public void setTimezone(String timezone)
                 throws ExpressionException
Throws:
ExpressionException

setBlockfactor

public void setBlockfactor(double blockfactor)
set the value blockfactor Specifies the maximum number of rows to fetch at a time from the server. The range is 1, default to 100. This parameter applies to ORACLE native database drivers and to ODBC drivers. Certain ODBC drivers may dynamically reduce the block factor at runtime.

Parameters:
blockfactor - value to set

setDbtype

public void setDbtype(String dbtype)
set the value dbtype The database driver type.

Parameters:
dbtype - value to set

setDebug

public void setDebug(boolean debug)
set the value debug Used for debugging queries. Specifying this attribute causes the SQL statement submitted to the data source and the number of records returned from the query to be returned.

Parameters:
debug - value to set

setDbname

public void setDbname(String dbname)
set the value dbname The database name, Sybase System 11 driver and SQLOLEDB provider only. If specified, dbName overrides the default database specified in the data source.

Parameters:
dbname - value to set
Throws:
ApplicationException

setMaxrows

public void setMaxrows(double maxrows)
set the value maxrows Specifies the maximum number of rows to return in the record set.

Parameters:
maxrows - value to set

setUsername

public void setUsername(String username)
set the value username If specified, username overrides the username value specified in the data source setup.

Parameters:
username - value to set

setProvider

public void setProvider(String provider)
set the value provider COM provider, OLE-DB only.

Parameters:
provider - value to set
Throws:
ApplicationException

setDbserver

public void setDbserver(String dbserver)
set the value dbserver For native database drivers and the SQLOLEDB provider, specifies the name of the database server computer. If specified, dbServer overrides the server specified in the data source.

Parameters:
dbserver - value to set
Throws:
ApplicationException

setName

public void setName(String name)
set the value name The name query. Must begin with a letter and may consist of letters, numbers, and the underscore character, spaces are not allowed. The query name is used later in the page to reference the query's record set.

Parameters:
name - value to set

getName

public String getName()

setParam

public void setParam(SQLItem item)
Parameters:
item -

doStartTag

public int doStartTag()
               throws PageException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class TagImpl
Throws:
PageException

doFinally

public void doFinally()
Specified by:
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinally
Overrides:
doFinally in class BodyTagTryCatchFinallyImpl

doEndTag

public int doEndTag()
             throws PageException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class TagImpl
Throws:
PageException

_call

public static Object _call(PageContext pc,
                           String hql,
                           Object params,
                           boolean unique,
                           Struct queryOptions)
                    throws PageException
Throws:
PageException

doInitBody

public void doInitBody()
Specified by:
doInitBody in interface javax.servlet.jsp.tagext.BodyTag
Overrides:
doInitBody in class BodyTagImpl

doAfterBody

public int doAfterBody()
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class BodyTagImpl


Copyright © 2012 Railo