public class MysqliResult extends JdbcResultResource
Modifier and Type | Field and Description |
---|---|
int |
num_rows |
_metaData, _rs, BLOB, COLUMN_CASE_LOWER, COLUMN_CASE_NATURAL, COLUMN_CASE_UPPER, DATE, DATETIME, FETCH_ASSOC, FETCH_BOTH, FETCH_NUM, INTEGER, REAL, STRING, TIME, TIMESTAMP, UNKNOWN, YEAR
Constructor and Description |
---|
MysqliResult(java.sql.ResultSetMetaData metaData,
Mysqli conn)
Constructor for MysqliResult
|
MysqliResult(java.sql.Statement stmt,
java.sql.ResultSet rs,
Mysqli conn)
Constructor for MysqliResult
|
Modifier and Type | Method and Description |
---|---|
boolean |
data_seek(Env env,
int rowNumber)
Seeks to an arbitrary result pointer specified
by the offset in the result set represented by result.
|
Value |
fetch_array(Env env,
int type)
Fetch a result row as an associative, a numeric array, or both.
|
Value |
fetch_assoc(Env env)
Returns an associative array representing the row.
|
Value |
fetch_field_direct(Env env,
int offset)
Returns field metadata for a single field.
|
Value |
fetch_field(Env env)
Returns the next field in the result set.
|
Value |
fetch_fields(Env env)
Returns metadata for all fields in the result set.
|
Value |
fetch_lengths()
Returns the lengths of the columns of the
current row in the result set.
|
Value |
fetch_object(Env env,
java.lang.String className,
Value[] args)
Returns an object representing the current row.
|
Value |
fetch_row(Env env)
Returns a numerical array representing the current row.
|
protected Value |
fetchFieldDirect(Env env,
int fieldOffset)
returns an object containing the following field information:
name: The name of the column
orgname: The original name if an alias was specified
table: The name of the table
orgtable: The original name if an alias was specified
def: default value for this field, represented as a string
max_length: The maximum width of the field for the result set
flags: An integer representing the bit-flags for the field (see _constMap).
|
protected Value |
fetchFieldImproved(Env env,
int fieldLength,
java.lang.String name,
java.lang.String originalName,
java.lang.String table,
int jdbcType,
java.lang.String mysqlType,
int scale)
Returns an object with the following fields:
name: The name of the column
orgname: The original name if an alias was specified
table: The name of the table
orgtable: The original name if an alias was specified
def: default value for this field, represented as a string
max_length: The maximum width of the field for the result set
flags: An integer representing the bit-flags for the field
type: An integer respresenting the data type used for this field
decimals: The number of decimals used (for integer fields)
|
protected Value |
fetchFieldImproved(Env env,
java.sql.ResultSetMetaData md,
int offset) |
protected Value |
fetchNextField(Env env) |
int |
field_count(Env env)
Returns the number of fields in the result set.
|
boolean |
field_seek(Env env,
int offset)
Sets the field metadata cursor to the
given offset.
|
int |
field_tell(Env env)
Get current field offset of a result pointer.
|
void |
free_result()
Closes the result
|
void |
free()
Closes the result.
|
protected Value |
getColumnString(Env env,
java.sql.ResultSet rs,
java.sql.ResultSetMetaData md,
int column) |
Value |
getFieldDirectArray(Env env) |
Value |
getFieldFlagsImproved(Env env,
int jdbcType,
java.lang.String mysqlType)
Returns the following field flags: not_null,
primary_key, multiple_key, blob,
unsigned zerofill, binary, enum, auto_increment and timestamp
it does not return the MySQL / PHP flag unique_key
MysqlModule generates a special result set with the appropriate values
|
protected java.lang.String |
getFieldType(int fieldOffset,
int jdbcType)
Given the JDBC type of the field at the given offset,
return a PHP type string.
|
protected java.lang.String |
getMysqlType(int fieldOffset)
Get Mysql type string
|
java.lang.String |
getResourceType() |
boolean |
isLastSqlDescribe() |
int |
num_fields()
Get the number of fields in the result set.
|
int |
num_rows()
Get the number of rows in the result set.
|
close, fetchArray, fetchArray, fetchAssoc, fetchBoth, fetchBound, fetchField, fetchNum, fetchObject, fetchRow, getAffectedRows, getBlobValue, getClobValue, getColumnDate, getColumnLabel, getColumnNumber, getColumnNumber, getColumnTime, getColumnTimestamp, getColumnValue, getColumnValue, getFieldCatalog, getFieldCount, getFieldLength, getFieldName, getFieldNameAlias, getFieldNotNull, getFieldOffset, getFieldScale, getFieldSchema, getFieldTable, getFieldType, getJdbcType, getLengths, getMetaData, getNumFields, getNumRows, getResultField, getResultSet, getUnicodeColumnString, isInResultString, isValidFieldOffset, next, seek, setAffectedRows, setFieldOffset, setRowNumber, toString, validateResult
public MysqliResult(java.sql.Statement stmt, java.sql.ResultSet rs, Mysqli conn)
stmt
- the corresponding statementrs
- the corresponding result setconn
- the corresponding connectionpublic MysqliResult(java.sql.ResultSetMetaData metaData, Mysqli conn)
metaData
- the corresponding result set meta dataconn
- the corresponding connectionpublic java.lang.String getResourceType()
public boolean isLastSqlDescribe()
public boolean data_seek(Env env, int rowNumber)
env
- the PHP executing environmentrowNumber
- the row offsetpublic Value fetch_array(Env env, int type)
type
- one of MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH (default)
By using the MYSQLI_ASSOC constant this function will behave
identically to the mysqli_fetch_assoc(), while MYSQLI_NUM will
behave identically to the mysqli_fetch_row() function. The final
option MYSQLI_BOTH will create a single array with the attributes
of both.public Value fetch_assoc(Env env)
public Value fetch_field_direct(Env env, int offset)
env
- the PHP executing environmentoffset
- the field numberpublic Value fetch_field(Env env)
env
- the PHP executing environmentpublic Value fetch_fields(Env env)
env
- the PHP executing environmentpublic Value fetch_lengths()
public Value fetch_object(Env env, java.lang.String className, Value[] args)
env
- the PHP executing environmentpublic Value fetch_row(Env env)
public int field_count(Env env)
env
- the PHP executing environmentprotected Value fetchFieldDirect(Env env, int fieldOffset)
env
- the PHP executing environmentfieldOffset
- 0 <= fieldOffset < number of fieldsprotected Value fetchFieldImproved(Env env, java.sql.ResultSetMetaData md, int offset)
protected Value fetchFieldImproved(Env env, int fieldLength, java.lang.String name, java.lang.String originalName, java.lang.String table, int jdbcType, java.lang.String mysqlType, int scale)
env
- the PHP executing environmentfieldLength
- the field length as defined in the table declaration.name
- the field nameoriginalName
- the field original nametable
- the field table nametype
- the field typescale
- the field scalepublic Value getFieldFlagsImproved(Env env, int jdbcType, java.lang.String mysqlType)
protected java.lang.String getMysqlType(int fieldOffset)
fieldOffset
- the field number (0-based)protected java.lang.String getFieldType(int fieldOffset, int jdbcType)
getFieldType
in class JdbcResultResource
protected Value fetchNextField(Env env)
env
- the PHP executing environmentfetchFieldDirect
increments the fieldOffset counter by one;
public boolean field_seek(Env env, int offset)
env
- the PHP executing environmentpublic int field_tell(Env env)
env
- the PHP executing environmentpublic void free()
public void free_result()
public Value getFieldDirectArray(Env env)
env
- the PHP executing environmentpublic int num_fields()
public int num_rows()
protected Value getColumnString(Env env, java.sql.ResultSet rs, java.sql.ResultSetMetaData md, int column) throws java.sql.SQLException
getColumnString
in class JdbcResultResource
java.sql.SQLException