123456789101112131415161718192021 |
- package test.main.DB;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class TestBatchDbConnection{
- private static final String DRIVERNAME = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- public Connection getConnection() throws SQLException, ClassNotFoundException {
- Class.forName(DRIVERNAME);
- Connection connection = DriverManager
- .getConnection("jdbc:sqlserver://192.168.100.183;databaseName=HND110109_0625;user=sa;password=sa");
- return connection;
- }
- public void freeConnection(Connection conn) throws SQLException {
- conn.close();
- }
- }
|