22,209
社区成员
发帖
与我相关
我的任务
分享
ConnDB conn= new ConnDB();
PreparedStatement stmt = null;
try {
stmt = conn.getConn().prepareStatement("select top 10 x1,x2,x3,x4 from info where a=? order by b");
for(int i=0;i<s.length;i++)
{
stmt.setString(1,s[i]);
stmt.addBatch();
}
stmt.executeBatch();
ResultSet rs=stmt.getResultSet();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ConnDB conn= new ConnDB();
PreparedStatement stmt = null;
try {
stmt = conn.getConn().prepareStatement("select top 10 x1,x2,x3,x4 from info where a=? order by b");
for(int i=0;i<s.length;i++)
{
stmt.setString(1,s[i]);
stmt.addBatch();
}
stmt.executeBatch();
ResultSet rs=stmt.getResultSet();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
declare @s varchar(8000)
select @s=isnull(@s+',','')+ltrim(numid) from tb
select @s