net.sourceforge.jtds.jdbc

Class ProcEntry


public class ProcEntry
extends java.lang.Object

Stores information about a cached stored procedure or statement handle.
Version:
$Id: ProcEntry.java,v 1.1 2005/05/25 09:24:03 alin_sinpalean Exp $

Field Summary

static int
CURSOR
The entry references a prepared cursor handle.
static int
PREPARE
The entry references a prepared statement handle.
static int
PREP_FAILED
The entry references a failed prepare.
static int
PROCEDURE
The entry references a stored procedure.
private ColInfo[]
colMetaData
Column meta data (Sybase only).
private String
name
Stored procedure name or statement handle.
private ParamInfo[]
paramMetaData
Parameter meta data (Sybase only).
private int
refCount
Usage count for this statement.
private int
type
Type of statement referenced by this entry.

Method Summary

void
addRef()
Increments the usage count.
void
appendDropSQL(StringBuffer sql)
Retrieves the SQL to drop this statement.
ColInfo[]
getColMetaData()
Retrieves the column meta data array.
ParamInfo[]
getParamMetaData()
Retrieves the parameter meta data array.
int
getRefCount()
Retreives the usage count.
int
getType()
Retrieves the statement implementation type.
void
release()
Decrements the usage count.
void
setColMetaData(ColInfo[] colMetaData)
Sets the column meta data.
void
setHandle(int handle)
Sets the prepared statement handle.
void
setName(String name)
Sets the procedure name.
void
setParamMetaData(ParamInfo[] paramMetaData)
Sets the parameter meta data.
void
setType(int type)
Sets the statement implementation type.
String
toString()
Retrieves the procedure or handle name.

Field Details

CURSOR

public static final int CURSOR
The entry references a prepared cursor handle.
Field Value:
3

PREPARE

public static final int PREPARE
The entry references a prepared statement handle.
Field Value:
2

PREP_FAILED

public static final int PREP_FAILED
The entry references a failed prepare.
Field Value:
4

PROCEDURE

public static final int PROCEDURE
The entry references a stored procedure.
Field Value:
1

colMetaData

private ColInfo[] colMetaData
Column meta data (Sybase only).

name

private String name
Stored procedure name or statement handle.

paramMetaData

private ParamInfo[] paramMetaData
Parameter meta data (Sybase only).

refCount

private int refCount
Usage count for this statement.

type

private int type
Type of statement referenced by this entry.

Method Details

addRef

public void addRef()
Increments the usage count.

appendDropSQL

public void appendDropSQL(StringBuffer sql)
Retrieves the SQL to drop this statement.

getColMetaData

public ColInfo[] getColMetaData()
Retrieves the column meta data array.
Returns:
the column meta data as ColInfo[]

getParamMetaData

public ParamInfo[] getParamMetaData()
Retrieves the parameter meta data array.
Returns:
the parameter meta data as a ParamInfo[]

getRefCount

public int getRefCount()
Retreives the usage count.
Returns:
the usage count as an int

getType

public int getType()
Retrieves the statement implementation type.
Returns:
the statement type as an int

release

public void release()
Decrements the usage count.

setColMetaData

public void setColMetaData(ColInfo[] colMetaData)
Sets the column meta data.
Parameters:
colMetaData - the column meta data

setHandle

public void setHandle(int handle)
Sets the prepared statement handle.
Parameters:
handle - the sp_prepare handle value

setName

public void setName(String name)
Sets the procedure name.
Parameters:
name - the procedure name

setParamMetaData

public void setParamMetaData(ParamInfo[] paramMetaData)
Sets the parameter meta data.
Parameters:
paramMetaData - the parameter meta data array

setType

public void setType(int type)
Sets the statement implementation type.
Parameters:
type - the type code (one of PROCEDURE,PREPARE,CURSOR)

toString

public final String toString()
Retrieves the procedure or handle name.
Returns:
the statement or handle name as a String

Generated on September 18 2009