forked from cj-schultz/CS1555_Term_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam88_driver.java
56 lines (48 loc) · 1.74 KB
/
team88_driver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.util.*;
import java.io.*;
import java.sql.*;
import java.text.ParseException;
public class team88_driver
{
private static Connection connection;
private static String username = "";
private static String password = "";
private static String url = "jdbc:oracle:thin:@class3.cs.pitt.edu:1521:dbclass";
public static void main(String args[])
{
// Open the connection
try
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
connection = DriverManager.getConnection(url, username, password);
}
catch(Exception e)
{
System.out.println("Error connecting to the database. Error: ");
e.printStackTrace();
}
System.out.println("\n##############################################");
System.out.println("# #");
System.out.println("# EXECUTING CUSTOMER INTERFACE FUNCTIONS #");
System.out.println("# #");
System.out.println("##############################################\n");
// Do all customer queries
CustomerDriver.Begin(connection);
System.out.println("\n###################################################");
System.out.println("# #");
System.out.println("# EXECUTING ADMINISTRATOR INTERFACE FUNCTIONS #");
System.out.println("# #");
System.out.println("###################################################\n");
// Do all admin queries
AdminDriver.Begin(connection);
// Close the connection
try
{
connection.close();
}
catch(Exception Ex)
{
System.out.println("Error connecting to database. Machine Error: " + Ex.toString());
}
}
}