summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/Driver.java.in
diff options
context:
space:
mode:
authorDave Cramer <davec@fastcrypt.com>2002-03-16 02:15:23 +0000
committerDave Cramer <davec@fastcrypt.com>2002-03-16 02:15:23 +0000
commit134fe5ec61cb280459a4782b6d465e115c5ac5a8 (patch)
tree1059f66a82e015c51797fd3df6e3cd5dc19a1097 /src/interfaces/jdbc/org/postgresql/Driver.java.in
parentefd45bc68f3d371c5cdd701b6399026d5c18e20e (diff)
downloadpostgresql-134fe5ec61cb280459a4782b6d465e115c5ac5a8.tar.gz
fixed QueryExecuter to deal with multiple errors
previously it was throwing a SQLException as soon as the error message was received from the backend. This did not allow the protocol to finish properly now, simply collects error messages from the backend until the query is done and throws exception at the end Also added setLogLevel to Driver.java, and made the log levels public
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/Driver.java.in')
-rw-r--r--src/interfaces/jdbc/org/postgresql/Driver.java.in24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/Driver.java.in b/src/interfaces/jdbc/org/postgresql/Driver.java.in
index 5263cf9d0b..a6d0fb03a2 100644
--- a/src/interfaces/jdbc/org/postgresql/Driver.java.in
+++ b/src/interfaces/jdbc/org/postgresql/Driver.java.in
@@ -27,11 +27,13 @@ import org.postgresql.util.PSQLException;
public class Driver implements java.sql.Driver
{
- protected static final int DEBUG = 0;
- protected static final int INFO = 1;
- protected static final int WARN = 2;
- protected static final int ERROR = 3;
- protected static final int FATAL = 4;
+ // make these public so they can be used in setLogLevel below
+
+ public static final int DEBUG = 0;
+ public static final int INFO = 1;
+ public static final int WARN = 2;
+ public static final int ERROR = 3;
+ public static final int FATAL = 4;
private static int logLevel = FATAL;
@@ -439,6 +441,18 @@ public class Driver implements java.sql.Driver
{
return new PSQLException("postgresql.unimplemented");
}
+
+ /**
+ * used to turn logging on to a certain level, can be called
+ * by specifying fully qualified class ie org.postgresql.Driver.setLogLevel()
+ * @param int logLevel sets the level which logging will respond to
+ * FATAL being almost no messages
+ * DEBUG most verbose
+ */
+ public static void setLogLevel(int logLevel)
+ {
+ Driver.logLevel = logLevel;
+ }
/*
* logging message at the debug level
* messages will be printed if the logging level is less or equal to DEBUG