public class GOBIIDbUtils
These methods were largely borrowed from Jeff's privatemaizegenetics GenomeAnnosDB.java, then modified as needed for GOBII postgres access. Currently, this file is ONLY connecting to postgres, not monetd. if plugins are created that need to connect to monetdb, a new connectToDB() method for monetdb must be created, or the existing one will need to be changed to indicate the database type for connection. For connecting to a monetdb instance, see example in privatemaizegenetics.lynn.MonetdbFileProcessing.MonetDBQtoPosList.connectToDBOrDie
public static java.sql.Connection connectToDB(java.lang.String configFile)
public static java.sql.Connection connectToDatabaseOrDie(java.lang.String dbName,
java.util.Properties props)
public static java.lang.String[] readNextLine(java.io.BufferedReader reader,
java.lang.String inFile)
public static void postgreSQLCopyFromReader(java.sql.Connection conn,
java.lang.String table,
java.io.BufferedReader reader)
public static java.sql.ResultSet executePostgreSQLQuery(java.sql.Statement st,
java.lang.String query,
boolean echoQuery)
public static void populateTableFromFile(java.sql.Connection conn,
java.lang.String table,
java.lang.String sourceFile,
boolean header)
public static java.sql.Statement createPostgreSQLStatement(java.sql.Connection conn)
public static void printPostgreSQLResultSet(java.sql.ResultSet rs)
public static void printPostgreSQLResultSet(java.sql.ResultSet rs,
int stride)
public static void printPostgreSQLResultSetToFile(java.sql.ResultSet rs,
java.lang.String outFile)