📄 mpostgresutil.java
字号:
package net.jumperz.app.MGuardian.plugin.sessionIdManager2;
import java.sql.*;
import net.jumperz.sql.*;
public class MPostgresUtil
implements MDatabaseUtil
{
//--------------------------------------------------------------------------------
public boolean tableExists( Connection connection )
throws SQLException
{
String queryString =
"select count(*) from pg_tables where tablename = 'tstate'";
boolean tableExists = false;
int count = MSqlUtil.getInt( connection, queryString );
if( count == 1 )
{
tableExists = true;
}
return tableExists;
}
//--------------------------------------------------------------------------------
public void createTable( Connection connection )
throws SQLException
{
// create table
String queryString = "create table tstate ( t timestamp, ip varchar( 15 ), host text, paramName text, paramValue text, userAgent text )";
MSqlUtil.executeUpdate( connection, queryString );
// create index
queryString = "create index tIndex on tstate( t )";
MSqlUtil.executeUpdate( connection, queryString );
}
//--------------------------------------------------------------------------------
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -