private void fetchColumns ( ) { Vector temp = new Vector ( 20 ) ; Vector tempType = new Vector ( 20 ) ; try { if ( cConn == null ) { return ; } if ( dbmeta == null ) { dbmeta = cConn . getMetaData ( ) ; } ResultSet colList = dbmeta . getColumns ( null , null , tableName , "%" ) ; while ( colList . next ( ) ) { temp . addElement ( colList . getString ( "COLUMN_NAME" ) ) ; tempType . addElement ( new Short ( colList . getShort ( "DATA_TYPE" ) ) ) ; } colList . close ( ) ; } catch ( SQLException e ) { ZaurusEditor . printStatus ( "SQL Exception: " + e . getMessage ( ) ) ; } columns = new String [ temp . size ( ) ] ; temp . copyInto ( columns ) ; columnTypes = new short [ temp . size ( ) ] ; for ( int i = 0 ; i < columnTypes . length ; i ++ ) { columnTypes [ i ] = ( ( Short ) tempType . elementAt ( i ) ) . shortValue ( ) ; } }
fetch all column names