Java-SQL Connection
Archived 2 years ago
M
Alex
Playing Custom Status
Copy Paster!
Hi anyone reading,
I have a project I am working on which requires a Java-sql connection, however after following videos and forum posts, I still cant establish a connection between my database and java code, Ive used older and new versions of the NetBeans IDE (8.2 and 16) yet it still doesnt work. I either receive an invalid database URL or an incorrect login.
The following are my driver and my url:
driverClass =
"com.microsoft.sqlserver.jdbc.SQLServerDriver";
url = "jdbc:sqlserver://localhost:1433;databaseName=ConTest1;integratedSecurity=true";
the first image (the smaller one) is the error received when running the exact same code on netbeans 8.2, whereas the second image is the errors received when running the code on netbeans 16.
for the netbeans 16 code it seems like the issue is coming from my DriverManager.getConnection(url) so id assume something is wrong with the url, however after checking up on some forums about it and making some changes nothing seems to work.
Any advice?

