Skip to content

Commit b648566

Browse files
committed
minor edits
1 parent cb0863a commit b648566

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

lib/.DS_Store

0 Bytes
Binary file not shown.

src/DataConnection.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public static Connection createConnection() throws SQLException
1313
if(connection == null)
1414
{
1515
connection = DriverManager.getConnection(databaseURL, Constants.USERNAME, Constants.PASSWORD);
16-
System.out.println("Connected.");
1716
}
1817

1918
return connection;

src/DatabaseUtility.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.Calendar;
66

77
public class DatabaseUtility {
8-
8+
99
/*
1010
* Gets user using cardID as parameter
1111
* Returns User object
@@ -30,16 +30,16 @@ public static User getUser(String cardID) throws SQLException
3030
/*
3131
* Inserts new user into database and updates points
3232
*/
33-
public static void insertNewUser(User user, int points) throws SQLException
33+
public static void insertNewUser(String cardID, String accessID, int points) throws SQLException
3434
{
3535
Connection connection = DataConnection.createConnection();
3636
Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime());
3737

3838
String sql = "INSERT into points_fall_16 (cardID, accessID, points, last_checkin) values (?, ?, ?, ?)";
3939
PreparedStatement statement = connection.prepareStatement(sql);
40-
statement.setString(1, user.getCardID());
41-
statement.setString(2, user.getAccessID());
42-
statement.setInt(3, (user.getPoints() + points));
40+
statement.setString(1, cardID);
41+
statement.setString(2, accessID);
42+
statement.setInt(3, points);
4343
statement.setTimestamp(4, currentTimestamp);
4444
statement.executeUpdate();
4545
}

0 commit comments

Comments
 (0)