新手请教一个问题

09-11-26 tm2160

问题在下面

public class A {

DBconn conn = new DBconn();

public Pat_Visit demo1(String PATIENT_ID){

Pat_Visit visit = new Pat_Visit();

String strSQL="select NAME,DEPT_ADMISSION from INFO where ID=?";

ResultSet rs = conn.execQuery(strSQL,new Object[] {PATIENT_ID});

try {

while (rs.next()) {

visit.setNAME(rs.getString(1));

visit.setDEPT_ADMISSION_TO(rs.getString(2));

conn.closeConn();

return visit;

}

} catch (SQLException e) {

// TODO 自动生成 catch 块

e.printStackTrace();

conn.closeConn();

return null;

}

conn.closeConn();

return null;

}

public Dept_Dict demo2(){

在这个方法里如何得到demo1方法里的visit.setDEPT_ADMISSON_TO的数据?

}

}