From af63d5d93e3bb3e10d0bc0483c4b4e69b71f7ada Mon Sep 17 00:00:00 2001
From: Lathifah Nurrahmah <13515046@std.stei.itb.ac.id>
Date: Wed, 8 Nov 2017 19:50:50 +0700
Subject: [PATCH] change in signin

---
 IdentityService/nbproject/build-impl.xml      |  1 +
 IdentityService/nbproject/genfiles.properties |  9 ++-
 IdentityService/nbproject/project.properties  |  6 +-
 IdentityService/nbproject/project.xml         |  3 +
 IdentityService/nbproject/rest-build.xml      | 35 +++++++++
 IdentityService/src/conf/persistence.xml      |  8 +++
 IdentityService/src/java/validate/SignIn.java | 39 +++++-----
 .../src/java/validate/ValidateToken.java      | 17 ++---
 .../web/WEB-INF/glassfish-resources.xml       | 14 ++++
 OjekOnlineWebservice/nbproject/build-impl.xml |  1 -
 .../nbproject/genfiles.properties             |  6 +-
 OjekOnlineWebservice/nbproject/jax-ws.xml     |  3 -
 .../nbproject/jaxws-build.xml                 | 35 ---------
 OjekOnlineWebservice/nbproject/project.xml    |  4 +-
 .../src/java/Account/accountObject.java       | 71 -------------------
 .../src/java/org/me/ojek/OjekWS.java          | 28 --------
 .../web/WEB-INF/glassfish-resources.xml       | 14 ++++
 WebApp/web/index.jsp                          |  5 +-
 data/derby.log                                |  1 -
 19 files changed, 119 insertions(+), 181 deletions(-)
 create mode 100644 IdentityService/nbproject/rest-build.xml
 create mode 100644 IdentityService/src/conf/persistence.xml
 create mode 100644 IdentityService/web/WEB-INF/glassfish-resources.xml
 delete mode 100644 OjekOnlineWebservice/nbproject/jaxws-build.xml
 delete mode 100644 OjekOnlineWebservice/src/java/Account/accountObject.java
 delete mode 100644 OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java
 create mode 100644 OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml

diff --git a/IdentityService/nbproject/build-impl.xml b/IdentityService/nbproject/build-impl.xml
index f47cd5c..d4bdbc5 100644
--- a/IdentityService/nbproject/build-impl.xml
+++ b/IdentityService/nbproject/build-impl.xml
@@ -18,6 +18,7 @@
 
         -->
 <project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="IdentityService-impl">
+    <import file="rest-build.xml"/>
     <import file="ant-deploy.xml"/>
     <fail message="Please build using Ant 1.7.1 or higher.">
         <condition>
diff --git a/IdentityService/nbproject/genfiles.properties b/IdentityService/nbproject/genfiles.properties
index c5c1856..b5addbb 100644
--- a/IdentityService/nbproject/genfiles.properties
+++ b/IdentityService/nbproject/genfiles.properties
@@ -1,8 +1,11 @@
-build.xml.data.CRC32=1d45bd4f
+build.xml.data.CRC32=686d0898
 build.xml.script.CRC32=e342e6c3
 build.xml.stylesheet.CRC32=651128d4@1.77.1.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=1d45bd4f
-nbproject/build-impl.xml.script.CRC32=21e9d869
+nbproject/build-impl.xml.data.CRC32=686d0898
+nbproject/build-impl.xml.script.CRC32=86f3d309
 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
+nbproject/rest-build.xml.data.CRC32=1d45bd4f
+nbproject/rest-build.xml.script.CRC32=7681ab86
+nbproject/rest-build.xml.stylesheet.CRC32=0cfeebcc@1.31.1
diff --git a/IdentityService/nbproject/project.properties b/IdentityService/nbproject/project.properties
index 08bfe2b..96807a8 100644
--- a/IdentityService/nbproject/project.properties
+++ b/IdentityService/nbproject/project.properties
@@ -1,5 +1,6 @@
 annotation.processing.enabled=true
 annotation.processing.enabled.in.editor=true
+annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false
 annotation.processing.processors.list=
 annotation.processing.run.all.processors=true
 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
@@ -53,7 +54,9 @@ javac.compilerargs=
 javac.debug=true
 javac.deprecation=false
 javac.processorpath=\
-    ${javac.classpath}
+    ${javac.classpath}:\
+    ${libs.eclipselink.classpath}:\
+    ${libs.eclipselinkmodelgen.classpath}
 javac.source=1.8
 javac.target=1.8
 javac.test.classpath=\
@@ -77,6 +80,7 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib
 persistence.xml.dir=${conf.dir}
 platform.active=default_platform
 resource.dir=setup
+rest.config.type=ide
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}
diff --git a/IdentityService/nbproject/project.xml b/IdentityService/nbproject/project.xml
index 3c4f3dd..06c99f8 100644
--- a/IdentityService/nbproject/project.xml
+++ b/IdentityService/nbproject/project.xml
@@ -2,6 +2,9 @@
 <project xmlns="http://www.netbeans.org/ns/project/1">
     <type>org.netbeans.modules.web.project</type>
     <configuration>
+        <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
+            <extension file="rest-build.xml" id="rest.5"/>
+        </buildExtensions>
         <data xmlns="http://www.netbeans.org/ns/web-project/3">
             <name>IdentityService</name>
             <minimum-ant-version>1.6.5</minimum-ant-version>
diff --git a/IdentityService/nbproject/rest-build.xml b/IdentityService/nbproject/rest-build.xml
new file mode 100644
index 0000000..37cd925
--- /dev/null
+++ b/IdentityService/nbproject/rest-build.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+        *** GENERATED - DO NOT EDIT  ***
+        -->
+<project name="IdentityService-rest-build" basedir=".." xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:jaxrs="http://www.netbeans.org/ns/jax-rs/1">
+    <target name="-check-trim">
+        <condition property="do.trim">
+            <and>
+                <isset property="client.urlPart"/>
+                <length string="${client.urlPart}" when="greater" length="0"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-trim-url" if="do.trim">
+        <pathconvert pathsep="/" property="rest.base.url">
+            <propertyset>
+                <propertyref name="client.url"/>
+            </propertyset>
+            <globmapper from="*${client.urlPart}" to="*/"/>
+        </pathconvert>
+    </target>
+    <target name="-spare-url" unless="do.trim">
+        <property name="rest.base.url" value="${client.url}"/>
+    </target>
+    <target name="test-restbeans" depends="run-deploy,-init-display-browser,-check-trim,-trim-url,-spare-url">
+        <replace file="${restbeans.test.file}" token="${base.url.token}" value="${rest.base.url}||${rest.application.path}"/>
+        <condition property="do.browse-url">
+            <istrue value="${display.browser}"/>
+        </condition>
+        <antcall target="browse-url"/>
+    </target>
+    <target name="browse-url" if="do.browse-url">
+        <nbbrowse url="${restbeans.test.url}"/>
+    </target>
+</project>
diff --git a/IdentityService/src/conf/persistence.xml b/IdentityService/src/conf/persistence.xml
new file mode 100644
index 0000000..3555a7c
--- /dev/null
+++ b/IdentityService/src/conf/persistence.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+  <persistence-unit name="IdentityServicePU" transaction-type="JTA">
+    <jta-data-source>java:app/account</jta-data-source>
+    <exclude-unlisted-classes>false</exclude-unlisted-classes>
+    <properties/>
+  </persistence-unit>
+</persistence>
diff --git a/IdentityService/src/java/validate/SignIn.java b/IdentityService/src/java/validate/SignIn.java
index 574d8f8..077239a 100644
--- a/IdentityService/src/java/validate/SignIn.java
+++ b/IdentityService/src/java/validate/SignIn.java
@@ -57,7 +57,7 @@ public class SignIn extends HttpServlet {
             }
             try
             (   Connection conn = DriverManager.getConnection(
-                    "jdbc:mysql://localhost:3306/Account?zeroDateTimeBehavior=convertToNull",
+                    "jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull",
                     "root",
                     ""); 
                 Statement stmt = conn.createStatement()) {
@@ -78,24 +78,30 @@ public class SignIn extends HttpServlet {
                     boolean ulang = true;
                     PreparedStatement dbStatementCek;
 
-                    while (ulang) {
+                    //while (ulang) {
                         token = new BigInteger(130, random).toString(32);
-                        sqlCek = "SELECT * FROM token WHERE token = ?";
-                        dbStatementCek = conn.prepareStatement(sqlCek);
-                        dbStatementCek.setString(1, token);
-                        ResultSet rsCek = dbStatementCek.executeQuery();
-                        if (rsCek.next()) {
-                            ulang = true;
-                        } else {
-                            ulang = false;
-                        }
-                    }
+                      //  sqlCek = "SELECT * FROM token WHERE token = ?";
+                      //  dbStatementCek = conn.prepareStatement(sqlCek);
+                     //   dbStatementCek.setString(1, token);
+                     //   ResultSet rsCek = dbStatementCek.executeQuery();
+                       // if (rsCek.next()) {
+                       //     ulang = true;
+                      //  } else {
+                        //    ulang = false;
+                      //  }
+                    //}
 
                     Date dNow = new Date();
                     SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
                     SimpleDateFormat timeFormat = new SimpleDateFormat ("HH:mm:ss");
                     String time_expired = timeFormat.format(dNow);
                     String date_expired = dateFormat.format(dNow);
+                    json.put("id",rs.getInt("id"));
+                    json.put("fullname",rs.getString("fullname"));
+                    json.put("username",rs.getString("username"));
+                    json.put("email",rs.getString("email"));
+                    json.put("phone_no",rs.getString("phone_no"));
+                    json.put("token",token);
                     String sqlInputToken;
                     sqlInputToken = "INSERT INTO token(id_account,token,date_expired,time_expired) VALUES(?,?,?,?)";
                     PreparedStatement dbStatementInputToken = conn.prepareStatement(sqlInputToken);
@@ -103,14 +109,9 @@ public class SignIn extends HttpServlet {
                     dbStatementInputToken.setString(2, token);
                     dbStatementInputToken.setString(3, date_expired);
                     dbStatementInputToken.setString(4, time_expired);
-                    int rsInputToken = dbStatementInputToken.executeUpdate();
+                    dbStatementInputToken.executeUpdate();
                     
-                    json.put("id",rs.getInt("id"));
-                    json.put("fullname",rs.getString("fullname"));
-                    json.put("username",rs.getString("username"));
-                    json.put("email",rs.getString("email"));
-                    json.put("phone_no",rs.getString("phone_no"));
-                    json.put("token",token);
+
                 } else {
                     boolean h = true;
                     if (!h) {
diff --git a/IdentityService/src/java/validate/ValidateToken.java b/IdentityService/src/java/validate/ValidateToken.java
index eda4513..669ea49 100644
--- a/IdentityService/src/java/validate/ValidateToken.java
+++ b/IdentityService/src/java/validate/ValidateToken.java
@@ -129,18 +129,16 @@ public class ValidateToken extends HttpServlet {
                         json.put("id",rs.getInt("id"));
                         json.put("fullname",rs.getString("fullname"));
                         json.put("username",rs.getString("username"));
-                        json.put("address",rs.getString("address"));
-                        json.put("postalcode",rs.getString("postalcode"));
-                        json.put("phonenumber",rs.getString("phonenumber"));
-                        json.put("token",tokenExpires);
+                        json.put("email",rs.getString("email"));
+                        json.put("phone_no",rs.getString("phone_no"));
+                        json.put("token",token);
                         json.put("validate",2);
                     } else {
                         json.put("id",rs.getInt("id"));
                         json.put("fullname",rs.getString("fullname"));
                         json.put("username",rs.getString("username"));
-                        json.put("address",rs.getString("address"));
-                        json.put("postalcode",rs.getString("postalcode"));
-                        json.put("phonenumber",rs.getString("phonenumber"));
+                        json.put("email",rs.getString("email"));
+                        json.put("phone_no",rs.getString("phone_no"));
                         json.put("token","");
                         json.put("validate",1);
                     }
@@ -148,9 +146,8 @@ public class ValidateToken extends HttpServlet {
                     json.put("id",0);
                     json.put("fullname","");
                     json.put("username","");
-                    json.put("address","");
-                    json.put("postalcode","");
-                    json.put("phonenumber","");
+                    json.put("email","");
+                    json.put("phone_no","");
                     json.put("token","");
                     json.put("validate",3);
                 }
diff --git a/IdentityService/web/WEB-INF/glassfish-resources.xml b/IdentityService/web/WEB-INF/glassfish-resources.xml
new file mode 100644
index 0000000..f781b39
--- /dev/null
+++ b/IdentityService/web/WEB-INF/glassfish-resources.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
+<resources>
+    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_account_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
+        <property name="serverName" value="localhost"/>
+        <property name="portNumber" value="3306"/>
+        <property name="databaseName" value="account"/>
+        <property name="User" value="root"/>
+        <property name="Password" value=""/>
+        <property name="URL" value="jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull"/>
+        <property name="driverClass" value="com.mysql.jdbc.Driver"/>
+    </jdbc-connection-pool>
+    <jdbc-resource enabled="true" jndi-name="java:app/account" object-type="user" pool-name="mysql_account_rootPool"/>
+</resources>
diff --git a/OjekOnlineWebservice/nbproject/build-impl.xml b/OjekOnlineWebservice/nbproject/build-impl.xml
index 6e5efe8..c8e3582 100644
--- a/OjekOnlineWebservice/nbproject/build-impl.xml
+++ b/OjekOnlineWebservice/nbproject/build-impl.xml
@@ -18,7 +18,6 @@
 
         -->
 <project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="OjekOnlineWebservice-impl">
-    <import file="jaxws-build.xml"/>
     <import file="ant-deploy.xml"/>
     <fail message="Please build using Ant 1.7.1 or higher.">
         <condition>
diff --git a/OjekOnlineWebservice/nbproject/genfiles.properties b/OjekOnlineWebservice/nbproject/genfiles.properties
index 6a9c265..06754af 100644
--- a/OjekOnlineWebservice/nbproject/genfiles.properties
+++ b/OjekOnlineWebservice/nbproject/genfiles.properties
@@ -1,9 +1,9 @@
-build.xml.data.CRC32=7ab6bb81
+build.xml.data.CRC32=6b137e31
 build.xml.script.CRC32=4d0c4679
 build.xml.stylesheet.CRC32=651128d4@1.77.1.1
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=7ab6bb81
-nbproject/build-impl.xml.script.CRC32=580298ae
+nbproject/build-impl.xml.data.CRC32=6b137e31
+nbproject/build-impl.xml.script.CRC32=52b430c8
 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
 nbproject/jaxws-build.xml.stylesheet.CRC32=6608c2cf
diff --git a/OjekOnlineWebservice/nbproject/jax-ws.xml b/OjekOnlineWebservice/nbproject/jax-ws.xml
index 9175d5f..0c9842b 100644
--- a/OjekOnlineWebservice/nbproject/jax-ws.xml
+++ b/OjekOnlineWebservice/nbproject/jax-ws.xml
@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jax-ws xmlns="http://www.netbeans.org/ns/jax-ws/1">
   <services>
-    <service name="OjekWS">
-      <implementation-class>org.me.ojek.OjekWS</implementation-class>
-    </service>
   </services>
   <clients/>
 </jax-ws>
diff --git a/OjekOnlineWebservice/nbproject/jaxws-build.xml b/OjekOnlineWebservice/nbproject/jaxws-build.xml
deleted file mode 100644
index 8bb19e7..0000000
--- a/OjekOnlineWebservice/nbproject/jaxws-build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
-        *** GENERATED FROM jax-ws.xml - DO NOT EDIT !                             ***
-        *** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes ***
-        *** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE             ***
-        *** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD                  ***
-
-        --><project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
-    <!--
-                ===================
-                JAX-WS WSGEN SECTION
-                ===================
-            -->
-    <target name="wsgen-init" depends="init, -do-compile">
-        <mkdir dir="${build.generated.sources.dir}/jax-ws/resources/"/>
-        <mkdir dir="${build.classes.dir}"/>
-        <mkdir dir="${build.classes.dir}/META-INF"/>
-        <property name="j2ee.platform.wsgen.classpath" value="${libs.jaxws21.classpath}"/>
-        <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
-            <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
-        </taskdef>
-    </target>
-    <target name="wsgen-OjekWS" depends="wsgen-init">
-        <copy todir="${build.classes.dir}/META-INF">
-            <fileset dir="${webinf.dir}" includes="wsit-org.me.ojek.OjekWS.xml"/>
-        </copy>
-        <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" keep="true" genwsdl="true" sei="org.me.ojek.OjekWS" xendorsed="true">
-            <classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}"/>
-        </wsgen>
-    </target>
-    <!--
-                ===================
-                JAX-WS WSIMPORT SECTION
-                ===================
-            -->
-</project>
diff --git a/OjekOnlineWebservice/nbproject/project.xml b/OjekOnlineWebservice/nbproject/project.xml
index 4b61eb4..fa910d8 100644
--- a/OjekOnlineWebservice/nbproject/project.xml
+++ b/OjekOnlineWebservice/nbproject/project.xml
@@ -2,9 +2,7 @@
 <project xmlns="http://www.netbeans.org/ns/project/1">
     <type>org.netbeans.modules.web.project</type>
     <configuration>
-        <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
-            <extension file="jaxws-build.xml" id="jaxws"/>
-        </buildExtensions>
+        <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1"/>
         <data xmlns="http://www.netbeans.org/ns/web-project/3">
             <name>OjekOnlineWebservice</name>
             <minimum-ant-version>1.6.5</minimum-ant-version>
diff --git a/OjekOnlineWebservice/src/java/Account/accountObject.java b/OjekOnlineWebservice/src/java/Account/accountObject.java
deleted file mode 100644
index 4198516..0000000
--- a/OjekOnlineWebservice/src/java/Account/accountObject.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package Account;
-
-import javax.xml.bind.annotation.*; 
-
-/**
- *
- * @author raudi
- */
-@XmlRootElement(name = "accountObject") 
-public class accountObject {
-    @XmlElement(name="fullname", required=true) 
-    private String fullname;
-    @XmlElement(name="username", required=true) 
-    private String username;
-    @XmlElement(name="email", required=true) 
-    private String email;
-    @XmlElement(name="phonenumber", required=true) 
-    private String phonenumber;
-    @XmlElement(name="token", required=true) 
-    private String token;
-    @XmlElement(name="validate", required=true) 
-    private int validate;
-    
-    public accountObject() {
-        fullname = ""; 
-        username = ""; 
-        email = "";
-        phonenumber = "";
-        token = "";
-        validate = 0;
-    } 
-    
-    public accountObject(int id, String fullname, String username, String email,
-                           String postalcode, String phonenumber, String token, int validate) {
-        this.fullname = fullname;
-        this.username = username;
-        this.email = email;
-        this.phonenumber = phonenumber;
-        this.token = token;
-        this.validate = validate;
-    }
-    
-    public String getFullname(){
-        return fullname;
-    }
-    
-    public String getUsername() {
-        return username;
-    }
-    
-    public String getEmail() {
-        return email;
-    }
-    
-    public String getPhonenumber() {
-        return phonenumber;
-    }
-    
-    public String getToken() {
-        return token;
-    }
-    
-    public int getValidate() {
-        return validate;
-    }
-}
diff --git a/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java b/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java
deleted file mode 100644
index c9c4a90..0000000
--- a/OjekOnlineWebservice/src/java/org/me/ojek/OjekWS.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.me.ojek;
-
-import javax.jws.WebService;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.ejb.Stateless;
-
-/**
- *
- * @author TIFAH06
- */
-@WebService(serviceName = "OjekWS")
-@Stateless()
-public class OjekWS {
-
-    /**
-     * This is a sample web service operation
-     */
-    @WebMethod(operationName = "hello")
-    public String hello(@WebParam(name = "name") String txt) {
-        return "Hello " + txt + " !";
-    }
-}
diff --git a/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml b/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml
new file mode 100644
index 0000000..f781b39
--- /dev/null
+++ b/OjekOnlineWebservice/web/WEB-INF/glassfish-resources.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
+<resources>
+    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_account_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
+        <property name="serverName" value="localhost"/>
+        <property name="portNumber" value="3306"/>
+        <property name="databaseName" value="account"/>
+        <property name="User" value="root"/>
+        <property name="Password" value=""/>
+        <property name="URL" value="jdbc:mysql://localhost:3306/account?zeroDateTimeBehavior=convertToNull"/>
+        <property name="driverClass" value="com.mysql.jdbc.Driver"/>
+    </jdbc-connection-pool>
+    <jdbc-resource enabled="true" jndi-name="java:app/account" object-type="user" pool-name="mysql_account_rootPool"/>
+</resources>
diff --git a/WebApp/web/index.jsp b/WebApp/web/index.jsp
index ccf1f1c..fe07c47 100644
--- a/WebApp/web/index.jsp
+++ b/WebApp/web/index.jsp
@@ -62,7 +62,6 @@
         }
         con.setRequestProperty("User-Agent", USER_AGENT);
         con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
-
         String urlParameters = "username="+username+"&password="+password;
 
         // Send post request
@@ -92,6 +91,7 @@
         }
         
         JSONObject JSobjek = null;
+        out.println(responsebuff.toString());
             try {
                 new JSONObject(responsebuff.toString());
                 } catch (JSONException ex) {
@@ -100,7 +100,6 @@
                 try {
                     new JSONArray(responsebuff.toString());
                 } catch (JSONException ex1) {
-                    
                 }
             }
         if (JSobjek!=null) {
@@ -143,7 +142,7 @@
   <body>
  	<div class="login" id="form-login">
  		<h2 class="title">---LOGIN---</h2>
-                <form name="form-login" action="profile.jsp" method="post">
+                <form name="form-login" action="index.jsp" method="post">
    		<div class="input-form">
    			<div class="label">
    				<p style="width: 120px;">Username</p>
diff --git a/data/derby.log b/data/derby.log
index 76333dc..e69de29 100644
--- a/data/derby.log
+++ b/data/derby.log
@@ -1 +0,0 @@
-Wed Nov 08 18:03:05 ICT 2017 : Apache Derby Network Server - 10.11.1.2 - (1629631) started and ready to accept connections on port 1527
-- 
GitLab