Skip to content
Advertisement

Tag: jdbc

Java to SQL Server using Windows Authentication

I am trying to connect to a remote SQL Server DB from a Java application without success. I am able to successfully connect to that SQL Server instance from a SQL client for Mac called SQLPro for MSSQL However, if I try to connect from the Java application using those same credentials, I always get a Login failed error, this

UPDATE with RETURNING: Not able to retrieve ResultSet

I’ve tested the following UPDATE-RETURNING statement in my PostgreSQL client, and it correctly updates and returns the updated rows. However, in Java, I’m not able to retrieve the ResultSet. statement.execute() and statement.getMoreResults() always return false and statement.getResultSet() returns null, always. Am I missing something here? Answer Well, I wasn’t really able to solve this properly. However, I ended up using

Why is it not updating

I’m trying to update my database where in the Book copies will be updated to 5 depending on the Book code. The Book copies I initialize in the database was 10. For now, I have a fixed value of 5 to change it. My plan is to decrement the copies by 1 if users borrowed it. But for now, I’m

Advertisement