mpostgresutil.java

来自「httptunnel.jar httptunnel java 源码」· Java 代码 · 共 36 行

JAVA
36
字号
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 + =
减小字号Ctrl + -
显示快捷键?