Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="sources"/>
<classpathentry kind="lib" path="Executable JAR/Employee Payroll System.jar"/>
<classpathentry kind="lib" path="Executable JAR/lib/sqlite3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Employee-Payroll-System</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Binary file added bin/org/payroll/DatabaseManager.class
Binary file not shown.
Binary file added bin/org/payroll/LoginFrame$1.class
Binary file not shown.
Binary file added bin/org/payroll/LoginFrame$2.class
Binary file not shown.
Binary file added bin/org/payroll/LoginFrame.class
Binary file not shown.
Binary file added bin/org/payroll/Main.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$1.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$10.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$11.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$12.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$13.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$2.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$3.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$4.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$5.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$6.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$7.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$8.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame$9.class
Binary file not shown.
Binary file added bin/org/payroll/MainFrame.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/payroll/employees/NewEmployeeFrame$1.class
Binary file not shown.
Binary file not shown.
Binary file added bin/org/payroll/employees/NewEmployeeFrame.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/org/payroll/preferences/NewLoginIdFrame$1.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 8 additions & 3 deletions sources/org/payroll/DatabaseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class DatabaseManager {

Connection conn;
Statement curs;
PreparedStatement ps;

public DatabaseManager(String db) {
ConnectionString = "jdbc:sqlite:" + db;
Expand Down Expand Up @@ -71,9 +72,13 @@ void initNewDatabase() {

public Boolean verifyLoginId(String username) {
try {
return curs.executeQuery(
"SELECT * FROM login_ids WHERE username=\"" + username + "\""
).next();

ps = conn.prepareStatement("SELECT * FROM login_ids WHERE lower(username) = ? "); // secure from sql injection
ps.setString(1, username);

return ps.executeQuery().next();


} catch (SQLException e) {
System.err.println(e.getMessage());
}
Expand Down