Java JDBC connect SQL Server 2019 in Netbeans IDE (Full Tutorial 2021)
Code in Video:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author DELL
*/
public class BDConnection {
public static void main(String[] args,int a) throws ClassNotFoundException, SQLException{
String hostname = "localhost";
String sqlInstanceName = " "; //computer name
String sqlDatabase = " "; //sql server database name
String sqlUser = "sa";
String sqlPassword = " "; //passwrod sa account
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//jdbc:sqlserver://localhost:1433;instance=COMPUTERBERRY;databaseName=Database;
String connectURL = "jdbc:sqlserver://" + hostname + ":1433"
+ ";instance=" + sqlInstanceName + ";databaseName=" + sqlDatabase;
Connection conn = DriverManager.getConnection(connectURL, sqlUser, sqlPassword);
System.out.println("Connect to database successful!!");
}
}
Web mvnrepository JDBC Library:
https://mvnrepository.com/artifact/co...
System requirements for the JDBC driver:
https://docs.microsoft.com/en-us/sql/...
Using the JDBC driver with Maven Central:
https://docs.microsoft.com/vi-vn/sql/...
On this page of the site you can watch the video online Java JDBC connect SQL Server 2019 in Netbeans IDE (Full Tutorial 2021) with a duration of hours minute second in good quality, which was uploaded by the user ComputerBerry 09 October 2021, share the link with friends and acquaintances, this video has already been watched 19,845 times on youtube and it was liked by 197 viewers. Enjoy your viewing!