de.topicmapslab.majortom.importer.file
Class PSQLTask

java.lang.Object
  extended by de.topicmapslab.majortom.importer.file.PSQLTask

public class PSQLTask
extends java.lang.Object

Utility class containing a method to start the PSQL Task imports large SQL files to a database.

Author:
Sven Krosse

Field Summary
private static java.lang.String ARG_PIPE
          constant for pipe in argument
private static java.lang.String ARG_QUIET
          constant for quiet argument
private static java.lang.String CMD_EXE
          constant for windows command
private static java.lang.String COMMAND
          constant for run command argument
private static java.lang.String OS_NAME
          constant for name of operation system
private static java.lang.String PGPASSWORD
          constant for PostGreSQL password variable
private static java.lang.String PSQL
          the PSQL command
private static java.lang.String SLASH
          the slash token
private static java.lang.String WINDOWS
          constant for windows
 
Constructor Summary
PSQLTask()
           
 
Method Summary
static void runPSQL(java.lang.String taskPath, java.lang.String filename, java.lang.String database, java.lang.String user, java.lang.String password)
          Method starts the psql task of the PostGreSql database manager to import the given large SQL file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLASH

private static final java.lang.String SLASH
the slash token

See Also:
Constant Field Values

PSQL

private static final java.lang.String PSQL
the PSQL command

See Also:
Constant Field Values

OS_NAME

private static final java.lang.String OS_NAME
constant for name of operation system

See Also:
Constant Field Values

WINDOWS

private static final java.lang.String WINDOWS
constant for windows

See Also:
Constant Field Values

ARG_PIPE

private static final java.lang.String ARG_PIPE
constant for pipe in argument

See Also:
Constant Field Values

ARG_QUIET

private static final java.lang.String ARG_QUIET
constant for quiet argument

See Also:
Constant Field Values

COMMAND

private static final java.lang.String COMMAND
constant for run command argument

See Also:
Constant Field Values

CMD_EXE

private static final java.lang.String CMD_EXE
constant for windows command

See Also:
Constant Field Values

PGPASSWORD

private static final java.lang.String PGPASSWORD
constant for PostGreSQL password variable

See Also:
Constant Field Values
Constructor Detail

PSQLTask

public PSQLTask()
Method Detail

runPSQL

public static final void runPSQL(java.lang.String taskPath,
                                 java.lang.String filename,
                                 java.lang.String database,
                                 java.lang.String user,
                                 java.lang.String password)
                          throws java.lang.Exception
Method starts the psql task of the PostGreSql database manager to import the given large SQL file.

Parameters:
taskPath - the path to psql task or null if the path is defined in search path
filename - the filename to import ( absolute path )
database - the database name to import to
user - the user
password - the password
Throws:
java.lang.Exception - thrown if anything fails or the task terminates before finishing