Skip to content
Advertisement

How to close com.microsoft.sqlserver.jdbc.SQLServerDataSource

I’m using sql server jdbc driver mssql-jdbc-9.2.1.jre8-sources.jar and create an object of com.microsoft.sqlserver.jdbc.SQLServerDataSource. After setting it up with host-credential-etc, opening Connection and closing Connection, how do I close SQLServerDataSource object itself, I could not find any method in API. https://javadoc.io/doc/com.microsoft.sqlserver/mssql-jdbc/9.2.1.jre8/com/microsoft/sqlserver/jdbc/SQLServerDataSource.html Note to closer: I’m NOT using C3P0 connection pool, that may have close option. Answer The SQLServerDataSource is a simple

How to avoid having multiple methods with different arguments for url construction

How to avoid having multiple methods with different arguments for url construction. I would like to optimize this further Answer One way to create an object called Endpoint which holds the required values: Then you can have only one invUrl method to which id and action can be passed and Endpoint object can be constructed. This can be passed to

Lwjgl window not opening

So I trying out lwjgl but I’m having a problem, when I try to create a window I get an error I just can’t figure out why. I have tried to lower my java version from java 16 to 14 but that didn’t work. Main Class: when I run my main class I get this error (on java jdk 16):

Advertisement