主题:大家帮忙看哈
import java.sql.*;
import test.sqlBean;
public class B extends sqlBean{
public static void main(String args[])throws
ClassNotFoundException,SQLException
{
String [color=FF0000]kind[/color]=new String("UserPeople");//UserPeople为一个表
sqlBean lg=new sqlBean();
ResultSet rs=lg.executeQuery("select*from"+ kind+" where id='10'");
while(rs.next())
{
String password1=rs.getString("Password");
System.out.println(password1);
}
}
}
我想做的是让它能够随kind不同在不同表中查询
import test.sqlBean;
public class B extends sqlBean{
public static void main(String args[])throws
ClassNotFoundException,SQLException
{
String [color=FF0000]kind[/color]=new String("UserPeople");//UserPeople为一个表
sqlBean lg=new sqlBean();
ResultSet rs=lg.executeQuery("select*from"+ kind+" where id='10'");
while(rs.next())
{
String password1=rs.getString("Password");
System.out.println(password1);
}
}
}
我想做的是让它能够随kind不同在不同表中查询