Тёмный

Connecting MS SQL Server to Java Net Beans (Filipino) 

LUTHER Dc
Подписаться 70
Просмотров 1 тыс.
50% 1

I dont know if this tutorial will work on you. But I hope that this steps will help you.
Steps in connecting Java to local Database ms sql
1. Install ms sql developer version
remove the '^' on link and paste to url
https:^//www.microsoft.com/en-us/sql-server/sql-server-downloads
2. Install standalone server
3. enable log in sql authentication
4. Download JBDC Driver
remove the '^' on link bellow and past to url
https:^//learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver16
5. Move mssql auth.dll file to java jdk
6. enable tcp ip port for sql server
7. import jar file to project library in java compiler
6. Input code for connection in main
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
+";encrypt=true;trustServerCertificate=true";
Connection conn = DriverManager.getConnection(connectURL, sqlUser, sqlPassword);
System.out.println("Connect to database successful!!");
7. If you still get error from port just change the enable settings each IP
Credits to ComputerBerry for my basis.

Опубликовано:

 

13 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@jazdalisay
@jazdalisay 5 месяцев назад
Good Day po Sir luther
@lutherdc
@lutherdc 5 месяцев назад
hahahhaha good day po
Далее
Java Database Connectivity | JDBC
20:34
Просмотров 295 тыс.
НЮША РОЖАЕТ?
00:17
Просмотров 757 тыс.
Apache Superset MSSQL Connect (SQL Server 2014+)
23:25
Craziest Nature Videos of the Decade
16:09
Просмотров 2 млн
22110052 DangHuuLoc Lab 10
13:31
Просмотров 4