Added word wrap option (problem: conflicts with folding)
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / sql / SQLMetaDataResults.java
index 61b3333..3835511 100644 (file)
@@ -42,10 +42,12 @@ public class SQLMetaDataResults extends SQLResultSetResults {
 
                List columns = new ArrayList();
                columns.add(new Column("ColumnName", "", 0)); //$NON-NLS-1$
-               columns.add(new Column("Type", "", 0)); //$NON-NLS-1$
+               columns.add(new Column("Type Name", "", 0)); //$NON-NLS-1$
                columns.add(new Column("Size", "", 0)); //$NON-NLS-1$
+               columns.add(new Column("Scale", "", 0)); //$NON-NLS-1$
                columns.add(new Column("Nullable", "", 0)); //$NON-NLS-1$
                columns.add(new Column("AutoIncrement", "", 0)); //$NON-NLS-1$
+               columns.add(new Column("Type", "", 0)); //$NON-NLS-1$
                setColumns((Column[]) columns.toArray(new Column[columns.size()]));
                
                ResultSetMetaData metaData = set.getMetaData();
@@ -55,14 +57,15 @@ public class SQLMetaDataResults extends SQLResultSetResults {
                        Vector row = new Vector();
                        row.addElement(metaData.getColumnName(i));
                        row.addElement(metaData.getColumnTypeName(i));
-                       int textSize = metaData.getColumnDisplaySize(i);
                        int precision = metaData.getPrecision(i);
-                       int scale = metaData.getScale(i);
-                       if (scale == 0 && precision == 0) {
-                               row.addElement(Integer.toString(precision));
-                       } else {
-                               row.addElement(textSize + ", " + precision + ", " + scale); //$NON-NLS-1$ //$NON-NLS-2$
+                       if (precision == 0) {
+                               precision = metaData.getColumnDisplaySize(i);
                        }
+                       int scale = metaData.getScale(i);
+                       
+                       row.addElement(new Integer(precision));
+                       row.addElement(new Integer(scale));
+                       
                        int nullable = metaData.isNullable(i);
                        if (nullable == ResultSetMetaData.columnNoNulls) {
                                row.addElement("Not Null"); //$NON-NLS-1$
@@ -80,9 +83,9 @@ public class SQLMetaDataResults extends SQLResultSetResults {
                                        : Boolean.FALSE)
                                        .toString());
                        rowList.add(new Row(row));
+                       row.addElement(new Integer(metaData.getColumnType(i)));
                }
                setRows((Row[]) rowList.toArray(new Row[rowList.size()]));
-               set.close();
        }
 
        public boolean isMetaData() {