I want to force a lower timeout setting for an Oracle DB connection. How do I set it?
Thanks
SlimerDudeSun 1 Apr 2018
I don't know how exactly, as typically those settings are specific to the DriverManager implementation. See this StackOverflow post for some hints on where to look:
ahhatem Sun 1 Apr 2018
Hi,
I want to force a lower timeout setting for an Oracle DB connection. How do I set it?
Thanks
SlimerDude Sun 1 Apr 2018
I don't know how exactly, as typically those settings are specific to the
DriverManagerimplementation. See this StackOverflow post for some hints on where to look:ahhatem Sun 1 Apr 2018
So, is the only way to do this is to edit:
fantom-1.0.70/src/sql/java/SqlConnImplPeer.javaand add something like:
public static SqlConn openDefault(String uri, String user, String pass) { try { SqlConnImpl self = SqlConnImpl.make(); DriverManager.setLoginTimeout(10); self.peer.jconn = DriverManager.getConnection(uri, user, pass); self.peer.supportsGetGenKeys = self.peer.jconn.getMetaData().supportsGetGeneratedKeys(); return self; } catch (SQLException e) { throw err(e); } }I was hoping I don't have to do this.
SlimerDude Sun 1 Apr 2018
setLoginTimeout()is a static method, so you should be able to something like this:then you don't need to update the sql pod.
ahhatem Sun 1 Apr 2018
Thanks, seems to work fine using JavaFFI.