Skip to content

Commit 91dd176

Browse files
committed
ADDING CONNECT AND DISCONNECT FUNCTIONALITY
1 parent 64ea531 commit 91dd176

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/main/java/com/napier/sem/App.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@
44

55
public class App {
66

7-
public static void main(String[] args) {
7+
public static void main(String[] args)
8+
{
9+
// Create new Application
10+
App a = new App();
811

12+
// Connect to database
13+
a.connect();
14+
15+
// Disconnect from database
16+
a.disconnect();
17+
}
18+
private Connection con = null;
19+
20+
public void connect() { /* load driver + DriverManager.getConnection(...) */ }
21+
22+
public void disconnect() { /* close con if not null */ }
23+
{
924
try {
1025
// Load Database driver
1126
Class.forName("com.mysql.cj.jdbc.Driver");

0 commit comments

Comments
 (0)