日期:2014-05-20  浏览次数:20729 次

谁能帮我看哈,怎么不能把查询的列数据放到combobox中哟?谢谢
database1.setConnection(new   com.borland.dx.sql.dataset.ConnectionDescriptor( "jdbc:odbc:third ",   "sa ",   " ",   false,   "sun.jdbc.odbc.JdbcOdbcDriver "));
database1.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_COMMITTED);
database1.setUseCaseSensitiveId(true);
database1.setUseTableName(false);
database1.setDatabaseName( " ");
queryDataSet1.setEnableInsert(true);

queryDataSet1.setQuery(new   com.borland.dx.sql.dataset.QueryDescriptor(database1,   "SELECT     StName   FROM   dbtraffic.dbo.StInfo     order   by   StID "   ,   null,   true,   Load.ALL));
        jComboBox1.setBounds(new   Rectangle(113,   9,   27,   22));
        jComboBox1.addItem( "AAA ");
        while(queryDataSet1.next())
        {
              jComboBox1.addItem(queryDataSet1.getString( "StName "));
        }

------解决方案--------------------
说清楚啊
------解决方案--------------------
楼主把问题说清楚啊,运行的时候抛了异常么?有在循环里加过输出看代码是否执行了么?