public int getRecord(String tableName) throws SQLException{
int c=0;
try{
rs=stmt.executeQuery("SELECT COUNT(Column1) as a from tableName");
if(rs.next())
c=rs.getInt("a");
}
catch(Exception e){ c=0; }
return c;
}
int c=0;
try{
rs=stmt.executeQuery("SELECT COUNT(Column1) as a from tableName");
if(rs.next())
c=rs.getInt("a");
}
catch(Exception e){ c=0; }
return c;
}
public int getColumnNumber(String tableName)
throws SQLException
{ int i=-1;
try
{
if(rs!=null)
rs.close();
rs=stmt.executeQuery("SELECT COUNT(Column1) from tableName");
i=rs.getInt(1);
}
catch(Exception e)
{
System.out.print("得到字段个数发生错误,Error " +e.toString());
}
return i;
}
int c=0;
try{
rs=stmt.executeQuery("SELECT COUNT(Column1) as a from tableName");
if(rs.next())
c=rs.getInt("a");
}
catch(Exception e){
System.out.println(e.getMessage());
c=0;
}
return c;
}