Methods Summary |
---|
public java.lang.String | getCatalogName(int column)
throw new SQLException("mSQL does not support catalogs.");
|
MsqlColumn | getColumn(int column)
waitOnLoad();
if( column < 1 || column > columns.size() ) {
throw new SQLException("Invalid column check.");
}
return (MsqlColumn)columns.elementAt(column-1);
|
public int | getColumnCount()
waitOnLoad();
return columns.size();
|
public int | getColumnDisplaySize(int column)
MsqlColumn c = getColumn(column);
return c.getLength();
|
public java.lang.String | getColumnLabel(int column)
MsqlColumn c = getColumn(column);
return (c.getTableName() + "." + c.getColumnName());
|
public java.lang.String | getColumnName(int column)
MsqlColumn c = getColumn(column);
return c.getColumnName();
|
public int | getColumnType(int column)
MsqlColumn c = getColumn(column);
return c.getType();
|
public java.lang.String | getColumnTypeName(int column)
MsqlColumn c = getColumn(column);
switch( c.getType() ) {
case Types.INTEGER:
return "INT";
case Types.CHAR:
return "CHAR";
case Types.REAL:
return "REAL";
default:
return "NULL";
}
|
public int | getPrecision(int column)
throw new SQLException("mSQL has no clue what the precision is.");
|
public int | getScale(int column)
throw new SQLException("mSQL has no clue what the scale is.");
|
public java.lang.String | getSchemaName(int column)
return schema;
|
public java.lang.String | getTableName(int column)
MsqlColumn c = getColumn(column);
return c.getTableName();
|
public boolean | isAutoIncrement(int column)
return false;
|
public boolean | isCaseSensitive(int column)
return true;
|
public boolean | isCurrency(int column)
return false;
|
public boolean | isDefinitelyWritable(int column)
return true;
|
public int | isNullable(int column)
MsqlColumn c = getColumn(column);
if( c.isNullable() ) {
return ResultSetMetaData.columnNullable;
}
else {
return ResultSetMetaData.columnNoNulls;
}
|
public boolean | isReadOnly(int column)
return false;
|
public boolean | isSearchable(int column)
return true;
|
public boolean | isSigned(int column)
return true;
|
public boolean | isWritable(int column)
return true;
|
public void | run()
try {
while( field_results.next() ) {
String tname, cname;
boolean nullable, pk;
int type, length;
schema =
field_results.getStatement().getConnection().getUser();
tname = field_results.getString(1);
cname = field_results.getString(2);
type = field_results.getInt(3);
length = field_results.getInt(4);
try {
String tmp = field_results.getString(5);
if( tmp.equals("Y") ) {
nullable = false;
}
else {
nullable = true;
}
}
catch( SQLException e ) {
nullable = true;
}
try {
String tmp = field_results.getString(6);
if( tmp.equals("Y") ) {
pk = true;
}
else {
pk = false;
}
}
catch( SQLException e ) {
pk = false;
}
columns.addElement(new MsqlColumn(cname, tname, type,
length, nullable, pk));
}
synchronized( columns ) {
complete = true;
columns.notify();
}
}
catch( SQLException e ) {
synchronized( columns ) {
load_exception = e;
complete = true;
columns.notify();
}
}
|
private void | waitOnLoad()
synchronized( columns ) {
while( !complete ) {
try {
columns.wait();
}
catch( InterruptedException e ) {
if( !complete ) {
throw new MsqlException(e);
}
}
if( load_exception != null ) {
throw load_exception;
}
}
}
|