首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

openfire(四)数据库浅析之序列

2013-03-21 
openfire(4)数据库浅析之序列??????????????????? thread contention. Trying again...)??????????? //

openfire(4)数据库浅析之序列
??????????????????? "thread contention. Trying again...");
??????????? // Call this method again, but sleep briefly to try to avoid thread contention.
??????????? try {
??????????????? Thread.sleep(75);
??????????? }
??????????? catch (InterruptedException ie) {
??????????????? // Ignore.
??????????? }
??????????? getNextBlock(count - 1);
??????? }
??? }

此方法为:更具类型到数据库中ofid查询ID,获取表中的id,然后id加一个变量,然后将新的id更新到数据库中。

?

private void createNewID(Connection con, int type) throws SQLException {
??????? Log.warn("Autocreating jiveID row for type '" + type + "'");

??????? // create new ID row
??????? PreparedStatement pstmt = null;

??????? try {
??????????? pstmt = con.prepareStatement(CREATE_ID);
??????????? pstmt.setInt(1, type);
??????????? pstmt.execute();
??????? }
??????? finally {
??????????? DbConnectionManager.closeStatement(pstmt);
??????? }
??? }

在表中创建一条序列的记录。

?

此篇文章就到此,稍后会有更多关于openfire的个人解读。

联系方式(qq):851392159

出处:http://buerkai.iteye.com

?

热点排行