userid.java

来自「图书」· Java 代码 · 共 51 行

JAVA
51
字号
package thizlinux.linuxhr;import java.sql.*;/** * @author root * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */public class UserId {	private int pid=100000;	private int eid=200000;	public UserId(){		DBconnect dbconn=new DBconnect();		ResultSet rs=null;		String sql="";		try{			sql="select  max(uid) from tbl_user where usertype=0";			rs=dbconn.executeQuery(sql);			rs.next();			int id=rs.getInt(1);			if(id>0)pid=id;			sql="select  max(uid) from tbl_user where usertype=1";			rs=dbconn.executeQuery(sql);			rs.next();			id=rs.getInt(1);			if(id>0)eid=id;		}catch(Exception e){			System.out.println(e+",sql="+sql);		}finally{			try{				if(rs!=null)rs.close();				if(dbconn!=null)dbconn.close();			}catch(Exception e){				System.out.println(e);			}		}	}	public synchronized int getpid()	{		pid=pid+1;		return pid;	}	public synchronized int geteid()	{		eid=eid+1;		return eid;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?