uk.ac.starlink.table.jdbc
Class JDBCUtils
java.lang.Object
uk.ac.starlink.table.jdbc.JDBCUtils
public class JDBCUtils
- extends Object
Utilties related to JDBC.
- Since:
- 10 Dec 2007
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createStreamingStatement
public static Statement createStreamingStatement(Connection conn,
boolean update)
throws SQLException
- Returns a statement which tries its best to stream data.
It may be necessary to jump through various (database/driver-dependent)
hoops to persuade JDBC not to grab the whole query result and
store it locally - doing that risks running out of heap memory
in this JVM for large queries.
Note that in some cases the supplied connection may have its
autocommit mode modified by this call.
- Parameters:
conn
- connectionupdate
- true for an updatable set, false for read-only
- Returns:
- statement which (hopefully) streams results
- Throws:
SQLException