Hello,
As promised, with H2 now being on GitHub (apparently for a while now, I
completely missed that), I'd love to contribute 1-2 things that I have
always found missing when developing jOOQ.
Before I start doing any work though, I do have a couple of questions. I
will send individual E-Mails for those.
First off, do you have any procedure for contributing? I'd like to avoid
doing any work that you'll probably reject, so I'd like to discuss first.
Is that done here on the list, or is a GitHub issue appropriate?
Secondly, I've found the current C-style templating for multi JDBC version
support a bit of an issue. Take the following method for instance:
/*## Java 1.7 ##
@Override
public int getNetworkTimeout() {
return 0;
}
//*/
On my newest computer, I only have JDK 8, which includes JDBC 4.2, so I
cannot build the version as in GitHub. I could, of course, call "build
switchSource", but now I have an annoying diff which I cannot
commit/contribute.
What we did in jOOQ (as we also support JDBC version 4.0 - 4.2) is a common
base class for all JDBC types such as Connection, which contains method
stubs for the methods that were added in JDBC 4.1. For instance:
public abstract class JDBC41Connection {
// JDBC 4.1 compliance: @Override
@SuppressWarnings("unused")
public final void setSchema(String s) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
// JDBC 4.1 compliance: @Override
@SuppressWarnings("unused")
public final String getSchema() throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
// JDBC 4.1 compliance: @Override
@SuppressWarnings("unused")
public final void abort(Executor executor) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
// JDBC 4.1 compliance: @Override
@SuppressWarnings("unused")
public final void setNetworkTimeout(Executor executor, int
milliseconds) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
// JDBC 4.1 compliance: @Override
@SuppressWarnings("unused")
public final int getNetworkTimeout() throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
}
This base class can then be extended by the actual Connection types to work
with JDBC 4.0, 4.1, and 4.2. Is that something worth contributing?
Cheers,
Lukas
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.