Java基础培训——第十节
作者:互联网
音乐管理系统的权限功能的添加
public int qxcx(String usename1) throws Exception
{
int type = 1;
Connection connection =DBUtil.getConection();
String sql =“select * from ub_user where username =?”;
PreparedStatement preparedStatement =connection.prepareStatement(sql);
preparedStatement.setString(1,usename1);
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()){
type=resultSet.getInt(4);
}
return type;
}
标签:preparedStatement,培训,String,int,resultSet,第十节,sql,Java,type 来源: https://blog.csdn.net/qqqnmn/article/details/99858175