|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.server.pg.PgServer
public class PgServer
This class implements a subset of the PostgreSQL protocol as described here: http://developer.postgresql.org/pgdocs/postgres/protocol.html The PostgreSQL catalog is described here: http://www.postgresql.org/docs/7.4/static/catalogs.html
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default port to use for the PG server. |
Constructor Summary | |
---|---|
PgServer()
|
Method Summary | |
---|---|
static int |
convertType(int type)
Convert the SQL type to a PostgreSQL type |
boolean |
getAllowOthers()
Check if remote connections are allowed. |
static java.lang.String |
getCurrentSchema(java.sql.Connection conn)
Get the name of the current schema. |
static int |
getCurrentTid(java.lang.String table,
java.lang.String id)
Get the current transaction id. |
static java.lang.String |
getEncodingName(int code)
Get the name of this encoding code. |
static java.lang.String |
getIndexColumn(java.sql.Connection conn,
int indexId,
java.lang.Integer ordinalPosition,
java.lang.Boolean pretty)
The Java implementation of the PostgreSQL function pg_get_indexdef. |
java.lang.String |
getName()
Get the human readable name of the service. |
int |
getPort()
Gets the port this service is listening on. |
static java.sql.Timestamp |
getStartTime()
Get the current system time. |
java.lang.String |
getType()
Get the human readable short name of the service. |
java.lang.String |
getURL()
Get the URL of this service in a human readable form |
static java.lang.String |
getUserById(java.sql.Connection conn,
int id)
Get the user name for this id. |
static java.lang.String |
getVersion()
Get the version. |
static boolean |
hasDatabasePrivilege(int id,
java.lang.String privilege)
Check if the this session has the given database privilege. |
static boolean |
hasTablePrivilege(java.lang.String table,
java.lang.String privilege)
Check if the current session has access to this table. |
void |
init(java.lang.String... args)
Initialize the service from command line options. |
boolean |
isRunning(boolean traceError)
Check if the service is running. |
void |
listen()
Listen for incoming connections. |
void |
start()
Start the service. |
void |
stop()
Stop the service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public PgServer()
Method Detail |
---|
public void init(java.lang.String... args)
Service
init
in interface Service
args
- the command line optionspublic java.lang.String getURL()
Service
getURL
in interface Service
public int getPort()
Service
getPort
in interface Service
public void start() throws java.sql.SQLException
Service
start
in interface Service
java.sql.SQLException
public void listen()
Service
listen
in interface Service
public void stop()
Service
stop
in interface Service
public boolean isRunning(boolean traceError)
Service
isRunning
in interface Service
traceError
- if errors should be written
public boolean getAllowOthers()
Service
getAllowOthers
in interface Service
public java.lang.String getType()
Service
getType
in interface Service
public java.lang.String getName()
Service
getName
in interface Service
public static java.lang.String getIndexColumn(java.sql.Connection conn, int indexId, java.lang.Integer ordinalPosition, java.lang.Boolean pretty) throws java.sql.SQLException
conn
- the connectionindexId
- the index idordinalPosition
- the ordinal position (null if the SQL statement
should be returned)pretty
- this flag is ignored
java.sql.SQLException
public static java.lang.String getCurrentSchema(java.sql.Connection conn) throws java.sql.SQLException
conn
- the connection
java.sql.SQLException
public static java.lang.String getEncodingName(int code)
code
- the encoding code
public static java.lang.String getVersion()
public static java.sql.Timestamp getStartTime()
public static java.lang.String getUserById(java.sql.Connection conn, int id) throws java.sql.SQLException
conn
- the connectionid
- the user id
java.sql.SQLException
public static boolean hasDatabasePrivilege(int id, java.lang.String privilege)
id
- the session idprivilege
- the privilege to check
public static boolean hasTablePrivilege(java.lang.String table, java.lang.String privilege)
table
- the table nameprivilege
- the privilege to check
public static int getCurrentTid(java.lang.String table, java.lang.String id)
table
- the table nameid
- the id
public static int convertType(int type)
type
- the SQL type
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |