初学java 各位朋友请指点一 二

04-09-01 Javalga
import java.util.*;

import java.sql.*;

class PrintData{

static void print(Iterator e){

while(e.hasNext())

System.out.print(e);

}

}

public class test {

public test() {

}

public static void main(String[] args) {

try{

DbConnection conn=new DbConnection();

String sql="select MineNum, SensorNum, Address, SensorCode, RTData, RTStatus, TimeVal from show_realtime_data";

ResultSet rs=conn.executeQuery(sql);

List v=new LinkedList();

int i=0;

while(rs.next())

{

List l = new LinkedList();

l.set(0,rs.getString("MineNum"));

l.set(1,rs.getString("SensorNum"));

v.add(l);

}

}catch(Exception e){

e.printStackTrace();

}finally{

}

}

}

请问以上代码错在哪儿啊?

我想打印整条记录,我该怎么做? 大哥,指点一下吧!!!

Javalga
2004-09-01 17:59
问题已经解决,为什么都不愿意帮助新手呢!哎!

猜你喜欢