@@ -0,0 +1,2055 @@
+package Entity;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0A%0A/**%0A *%0A * @author peter%0A */%0Apublic class Login %7B%0A%0A    public String logintoApplication(String userid, String password) throws SQLException %7B%0A        //String dbURL = %22jdbc:derby:http://localhost:1527/home/peter/pizzabase%22;%0A        String dbURL = %22jdbc:derby://localhost:1527//home/peter/pizzabase%22;%0A        String tableName = %22customer%22;%0A        // jdbc Connection%0A        Connection conn = null;%0A        Statement stmt = null;%0A        String result = null;%0A%0A        try%0A        %7B%0A            Class.forName(%22org.apache.derby.jdbc.ClientDriver%22).newInstance();%0A            //Get a connection%0A            conn = DriverManager.getConnection(dbURL); %0A        %7D%0A        catch (ClassNotFoundException cnfe) %7B%0A            System.err.println(%22Derby driver not found.%22);%0A        %7D%0A        catch (InstantiationException %7C IllegalAccessException %7C SQLException except)%0A        %7B%0A            except.printStackTrace();%0A        %7D%0A        %0A        try%0A        %7B%0A            stmt = conn.createStatement();%0A            ResultSet results = stmt.executeQuery(%22select * from %22 + tableName + %22 where id = '%22 + userid + %22' and password = '%22 + password + %22'%22);%0A%0A            if (results.next()) %7B%0A                result = %22OK%22;%0A            %7D else result = %22INVALID%22;%0A%0A%0A            results.close();%0A            stmt.close();%0A            %7D%0A            catch (SQLException sql)%0A            %7B%0A                sql.printStackTrace();%0A            %7D%0A%0A            try%0A            %7B%0A                if (stmt != null)%0A                %7B%0A                    stmt.close();%0A                %7D%0A                if (conn != null)%0A                %7B%0A                    DriverManager.getConnection(dbURL);%0A                    conn.close();%0A                %7D           %0A            %7D%0A            catch (SQLException sql)%0A            %7B%0A                sql.printStackTrace();%0A            %7D%0A            %0A        return result;%0A        %7D%0A    %7D%0A

Create Login.java