Ticker

6/recent/ticker-posts
thumbnail

DBConnection

 import com.mysql.jdbc.PreparedStatement;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.SQLException;

import java.sql.Statement;

public class DBConnection {

static Connection conn;

static Statement stat = null;

public static Statement getStatementConnection() {

try {

String url = "jdbc:mysql://localhost:3306/sms";

conn = DriverManager.getConnection(url, "root", "");

stat = conn.createStatement();

} catch (Exception e) {

e.printStackTrace();

}

return stat;

}


public static void closeCon() throws SQLException {

conn.close();

}

}

Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

About

Powered by Blogger.

Ad Code

Responsive Advertisement

Search This Blog

Blog Archive

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.

Subscribe Us

Popular Posts