public boolean isNew(String s)
{
getConnection();
boolean flag=false;
try
{
String s1 = "select value from doc_num where code='" + s + "'";
Statement statement = con.createStatement();
ResultSet resultset = statement.executeQuery(s1);
if(!resultset.next())
{
throw new RuntimeException("Can't find the specified code.code=" + s);
}
int i = resultset.getInt("value");
if(i == 0)
flag = true;
}
catch(Exception e)
{}
finally
{
closeConnection();
}
return flag;
}
{
getConnection();
boolean flag=false;
try
{
String s1 = "select value from doc_num where code='" + s + "'";
Statement statement = con.createStatement();
ResultSet resultset = statement.executeQuery(s1);
if(!resultset.next())
{
throw new RuntimeException("Can't find the specified code.code=" + s);
}
int i = resultset.getInt("value");
if(i == 0)
flag = true;
}
catch(Exception e)
{}
finally
{
closeConnection();
}
return flag;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货