Methods Summary |
---|
public void | cancel()
|
public void | clearWarnings()
warnings = null;
|
public void | close()
if( current != null ) {
try {
current.close();
}
catch( SQLException e ) {
current = null;
throw e;
}
current = null;
}
|
private void | closeAllResults()
if( result != null ) {
try {
result.close();
}
catch( SQLException e ) {
e.printStackTrace();
}
result = null;
}
if( current != null ) {
try {
current.close();
}
catch( SQLException e ) {
e.printStackTrace();
}
current = null;
}
|
public boolean | execute(java.lang.String sql)
ResultSet r = null;
closeAllResults();
if( !sendSQL(sql) ) {
return false;
}
else {
current = new MsqlResultSet(this, input, row_or_column_count);
result = current;
return true;
}
|
public synchronized java.sql.ResultSet | executeQuery(java.lang.String sql)
closeAllResults();
if( sendSQL(sql) ) {
current = new MsqlResultSet(this, input, row_or_column_count);
}
else {
throw new SQLException("Non-query sent to executeQuery().");
}
return current;
|
public int | executeUpdate(java.lang.String sql)
closeAllResults();
if( !sendSQL(sql) ) {
return row_or_column_count;
}
else {
throw new SQLException("Query sent to executeUpdate().");
}
|
MsqlConnection | getConnection()
return connection;
|
public int | getMaxFieldSize()
return max_field_size;
|
public int | getMaxRows()
return max_rows;
|
public int | getMoreCounts()
return -1;
|
public boolean | getMoreResults()
return (result != null);
|
public int | getQueryTimeout()
return timeout;
|
public java.sql.ResultSet | getResultSet()
ResultSet r;
r = result;
result = null;
return r;
|
public int | getUpdateCount()
int x = row_or_column_count;
if( result != null ) {
x = -1;
}
row_or_column_count = -1;
return x;
|
public final java.sql.SQLWarning | getWarnings()
return warnings;
|
private boolean | sendSQL(java.lang.String sql)
String tmp;
int i;
try {
output.writeAsciiString("3 " + sql);
tmp = input.readAsciiString();
}
catch( IOException e ) {
try {
connection.close();
close();
}
catch( SQLException ee ) {
}
throw new MsqlException(e);
}
i = tmp.indexOf(':");
if( i == -1 ) {
throw new SQLException("Incorrect mSQL response.");
}
row_or_column_count = Integer.parseInt(tmp.substring(0, i));
if( row_or_column_count == -1 ) {
throw new SQLException(tmp.substring(2));
}
i = tmp.indexOf(':", 2);
if( i == -1 ) {
return false;
}
else {
try {
row_or_column_count = Integer.parseInt(tmp.substring(2, i));
}
catch( NumberFormatException e ) {
row_or_column_count = 0;
return false;
}
return true;
}
|
public void | setCursorName(java.lang.String unused)
throw new SQLException("mSQL does not support cursors.");
|
public void | setEscapeProcessing(boolean enable)
throw new SQLException("mSQL does not support escape processing.");
|
public void | setMaxFieldSize(int max)
max_field_size = max;
|
public void | setMaxRows(int max)
max_rows = max;
|
public void | setQueryTimeout(int x)
timeout = x;
|