Tugas Online Pemrograman Web 2 – Kelas TI-S1&D3 ABCDM (Pagi Malam)

Hal : Tugas Tugas Online Pemrograman Web 2
Sifat : Individu (dapat saling berdiskusi)
Batas Pengumpulan :

  1. TI-S1 Kelas Pagi = 1 November 2016 Jam 16:30 WIB, Kelas Malam = 1 November 2016 Jam 21:30 WIB
  2. TI-D3 Kelas Pagi dan Malam 2 November 2016 Jam 21:30 WIB

Teknik Pengumpulan : Silakan tulis Script Web Service (Method Operationnya saja) di bagian Komentar pada artikel ini. Komentar yang Anda kirim, tidak akan langsung tampil, karena harus dalam proses moderasi terlebih dahulu. Jangan lupa sertakan NIM dan Nama. Pengiriman tugas digunakan untuk presensi dan nilai tugas.

NIM GANJIL

Terdapat 3 buah tabel database yaitu :
Tabel “mahasiswa

nim nama jurusan jenjang kd_pembimbing

Tabel “nilai

nim n_tugas n_uts n_uas n_akhir

Tabel “pembimbing_akademik

kd_pembimbing nama_pembimbing

Buatlah Script Method Operation Web Service untuk MENAMPILKAN data Nama Mahasiswa, Nilai Akhir, dan Nama Pembimbing Akademik. Sehingga hasil akhirnya pada saat Test Web Service, ketika di klik tombol tampil, akan muncul 3 data tersebut (nama, n_akhir, nama_pembimbing)

NIM GENAP

Terdapat sebuah tabel yaitu :
Tabel “nilai

nim nama jurusan jenjang n_akhir

Kondisi ketentuan :

Kurang                <60
Cukup                 >=60 sampai <75
Baik                     >=75 sampai <85
Memuaskan       >=85 sampai <=100

Buatlah Script Method Operation Web Service untuk MENCARI data nilai berdasarkan ketentuan diatas. Sehingga pada saat Test Web Service, dan dimasukkan kata “cukup”, maka daftar mahasiswa yang tampil adalah yang memiliki nilai akhir antara 60 sampai 74. Jika dimasukkan kata “memuaskan”, maka daftar mahasiswa yang tampil adalah yang memiliki nilai akhir antara 85 sampai 100.

Advertisements

117 comments on “Tugas Online Pemrograman Web 2 – Kelas TI-S1&D3 ABCDM (Pagi Malam)

  1. /*
    * 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 koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author ipul
    */
    @Stateless
    public class Koneksi {

    public List sinusMethod() {
    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/sinus”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con = DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from mahasiswa”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    ResultSet rs2=stmt.executeQuery(“select * from nilai”);
    while(rs2.next())
    list.add(rs2.getString(1)+”-“+rs2.getString(2)+”-“+rs2.getString(3)+”-“+rs2.getString(4)+”-“+rs2.getString(5));
    con.close();
    ResultSet rs3=stmt.executeQuery(“select * from pembimbingakademik”);
    while(rs3.next())
    list.add(rs3.getString(1)+”-“+rs3.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }

    public List mahasiswaMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List nilaiMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List pembimbingakademikMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author ipul
    */
    @WebService(serviceName = “TampilSinus”)
    public class TampilSinus {

    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “mahasiswaMethod”)
    public List mahasiswaMethod() {
    return ejbRef.mahasiswaMethod();
    }
    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }
    @WebMethod(operationName = “pembimbingakademikMethod”)
    public List pembimbingakademikMethod() {
    return ejbRef.pembimbingakademikMethod();
    }

    }

    Syaiful Effendi
    14.3.00041

    Like

  2. /*
    * 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 koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author Septiano
    */
    @Stateless
    public class Koneksi {

    public List sinusMethod() {
    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/sinus”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con = DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from mahasiswa”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    ResultSet rs2=stmt.executeQuery(“select * from nilai”);
    while(rs2.next())
    list.add(rs2.getString(1)+”-“+rs2.getString(2)+”-“+rs2.getString(3)+”-“+rs2.getString(4)+”-“+rs2.getString(5));
    con.close();
    ResultSet rs3=stmt.executeQuery(“select * from pembimbingakademik”);
    while(rs3.next())
    list.add(rs3.getString(1)+”-“+rs3.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }

    public List mahasiswaMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List nilaiMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List pembimbingakademikMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author Septiano
    */
    @WebService(serviceName = “TampilSinus”)
    public class TampilSinus {

    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “mahasiswaMethod”)
    public List mahasiswaMethod() {
    return ejbRef.mahasiswaMethod();
    }
    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }
    @WebMethod(operationName = “pembimbingakademikMethod”)
    public List pembimbingakademikMethod() {
    return ejbRef.pembimbingakademikMethod();
    }

    }

    Prasasti Septiano P
    14.3.00035

    Like

  3. /*
    * 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 koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author Amry
    */
    @Stateless
    public class Koneksi {

    public List sinusMethod() {
    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/sinus”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con = DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from mahasiswa”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    ResultSet rs2=stmt.executeQuery(“select * from nilai”);
    while(rs2.next())
    list.add(rs2.getString(1)+”-“+rs2.getString(2)+”-“+rs2.getString(3)+”-“+rs2.getString(4)+”-“+rs2.getString(5));
    con.close();
    ResultSet rs3=stmt.executeQuery(“select * from pembimbingakademik”);
    while(rs3.next())
    list.add(rs3.getString(1)+”-“+rs3.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }

    public List mahasiswaMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List nilaiMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List pembimbingakademikMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author Amry
    */
    @WebService(serviceName = “TampilSinus”)
    public class TampilSinus {

    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “mahasiswaMethod”)
    public List mahasiswaMethod() {
    return ejbRef.mahasiswaMethod();
    }
    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }
    @WebMethod(operationName = “pembimbingakademikMethod”)
    public List pembimbingakademikMethod() {
    return ejbRef.pembimbingakademikMethod();
    }

    }

    Amry Kurniawan
    14.3.00005

    Like

  4. /*
    * 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 koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author HeriKiswanto
    */
    @Stateless
    public class Koneksi {

    public List sinusMethod() {
    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/sinus”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con = DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from mahasiswa”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    ResultSet rs2=stmt.executeQuery(“select * from nilai”);
    while(rs2.next())
    list.add(rs2.getString(1)+”-“+rs2.getString(2)+”-“+rs2.getString(3)+”-“+rs2.getString(4)+”-“+rs2.getString(5));
    con.close();
    ResultSet rs3=stmt.executeQuery(“select * from pembimbingakademik”);
    while(rs3.next())
    list.add(rs3.getString(1)+”-“+rs3.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }

    public List mahasiswaMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List nilaiMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List pembimbingakademikMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }
    }
    ================================================================

    /*
    * 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 com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author HeriKiswanto
    */
    @WebService(serviceName = “TampilSinus”)
    public class TampilSinus {

    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “mahasiswaMethod”)
    public List mahasiswaMethod() {
    return ejbRef.mahasiswaMethod();
    }
    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }
    @WebMethod(operationName = “pembimbingakademikMethod”)
    public List pembimbingakademikMethod() {
    return ejbRef.pembimbingakademikMethod();
    }

    }
    ================================================================

    Heri Kiswanto – 14.3.00023 – TI.D3 Pagi

    Like

  5. package server.nilai;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.PreparedStatement;
    import java.util.ArrayList;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;

    @WebService(serviceName = “DaftarNilai”)
    public class DaftarNilai {

    Connection conn=null;
    PreparedStatement pstm=null;
    ResultSet rs=null;
    ConnectionMySQL connectSQL=new ConnectionMySQL();

    @WebMethod(operationName=”tampilNilai”)
    public ArrayList getNilai(){
    ArrayList nilai = new ArrayList();
    try {
    conn=connectSQL.getConnect();
    pstm=conn.prepareStatement(“select nim,”
    + “nama”,jurusan,jenjang”);
    rs=pstm.executeQuery();
    while(rs.next()){
    Nilai brg=new Nilai();
    brg.setnim(rs.getInt(“nim”));
    brg.setnama(rs.getString(“nama”));
    brg.setjurusan(rs.getString(“jurusan”));
    brg.setjenjang(rs.getString(“jenjang”));
    nilai.add(brg);
    }
    }catch (Exception e){
    System.out.println(“Kurang :”+e.toString());
    System.out.println(“Cukup :”+e.toString());
    System.out.println(“Baik :”+e.toString());
    System.out.println(“Memuaskan :”+e.toString());
    }return nilai;
    }
    }

    Deny Setiawan
    TI-D3
    14.3.00016

    Like

  6. package server.nilai;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.PreparedStatement;
    import java.util.ArrayList;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;

    @WebService(serviceName = “DaftarNilai”)
    public class DaftarNilai {

    Connection conn=null;
    PreparedStatement pstm=null;
    ResultSet rs=null;
    ConnectionMySQL connectSQL=new ConnectionMySQL();

    @WebMethod(operationName=”tampilNilai”)
    public ArrayList getNilai(){
    ArrayList nilai = new ArrayList();
    try {
    conn=connectSQL.getConnect();
    pstm=conn.prepareStatement(“select nim,”
    + “nama”,jurusan,jenjang”);
    rs=pstm.executeQuery();
    while(rs.next()){
    Nilai brg=new Nilai();
    brg.setnim(rs.getInt(“nim”));
    brg.setnama(rs.getString(“nama”));
    brg.setjurusan(rs.getString(“jurusan”));
    brg.setjenjang(rs.getString(“jenjang”));
    nilai.add(brg);
    }
    }catch (Exception e){
    System.out.println(“Kurang :”+e.toString());
    System.out.println(“Cukup :”+e.toString());
    System.out.println(“Baik :”+e.toString());
    System.out.println(“Memuaskan :”+e.toString());
    }return nilai;
    }
    }

    Like

  7. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author YUCK!
    */
    @Stateless
    public class Koneksi {
    public List nilaiMethod(){
    List list = new ArrayList();

    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:8080″+ “/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con =
    DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author YUCK!
    */
    @WebService(serviceName = “TampilNilai”)
    public class TampilNilai {
    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }

    }

    Nama : Catur Ariyanto
    NIMM : 14.3.00046

    Like

  8. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author WPS
    */
    @Stateless
    public class Koneksi {
    public List nilaiMethod(){
    List list = new ArrayList();

    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:8080″+ “/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con =
    DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author WPS
    */
    @WebService(serviceName = “TampilNilai”)
    public class TampilNilai {
    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }

    }

    Nama : Wildan Pratama Soja
    NIM : 14.3.00042

    Like

  9. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author TOSHIBA
    */
    @Stateless
    public class Koneksi {
    public List nilaiMethod(){
    List list = new ArrayList();

    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:8080″+ “/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con =
    DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author TOSHIBA
    */
    @WebService(serviceName = “TampilNilai”)
    public class TampilNilai {
    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }

    }

    Nama : Khodri Fatchurohman
    NIM : 14.3.00028

    Like

  10. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author DELL
    */
    @Stateless
    public class Koneksi {
    public List nilaiMethod(){
    List list = new ArrayList();

    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:8080″+ “/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con =
    DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author DELL
    */
    @WebService(serviceName = “TampilNilai”)
    public class TampilNilai {
    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }

    }

    Nama : Irvan Febrianto Y
    NIM : 14.3.00026

    Like

  11. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author Yuhhuu
    */
    @Stateless
    public class Koneksi {

    public List sinusMethod() {
    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/sinus”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con = DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from mahasiswa”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    ResultSet rs2=stmt.executeQuery(“select * from nilai”);
    while(rs2.next())
    list.add(rs2.getString(1)+”-“+rs2.getString(2)+”-“+rs2.getString(3)+”-“+rs2.getString(4)+”-“+rs2.getString(5));
    con.close();
    ResultSet rs3=stmt.executeQuery(“select * from pembimbingakademik”);
    while(rs3.next())
    list.add(rs3.getString(1)+”-“+rs3.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }

    public List mahasiswaMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List nilaiMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }

    public List pembimbingakademikMethod() {
    throw new UnsupportedOperationException(“Not supported yet.”); //To change body of generated methods, choose Tools | Templates.
    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author Yuhhuu
    */
    @WebService(serviceName = “TampilSinus”)
    public class TampilSinus {

    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “mahasiswaMethod”)
    public List mahasiswaMethod() {
    return ejbRef.mahasiswaMethod();
    }
    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }
    @WebMethod(operationName = “pembimbingakademikMethod”)
    public List pembimbingakademikMethod() {
    return ejbRef.pembimbingakademikMethod();
    }

    }

    Nama : Irham Nur P
    NIM : 14.3.00025

    Like

  12. Nama : Setiawan Adi Tiaputra
    Nim : 14.3.00044(nim genap)
    Kelas : TI.D3 Malam
    ———————————————————————-
    package mahasiswa.webservice;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import mahasiswa.webservice.util.DBConnection;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;

    /**
    *
    * @author Setiawan
    */
    @WebService(serviceName = “NilaiMahasiswa”)
    public class NilaiMahasiswa {
    private String[] data = new String[5];
    @EJB
    private DBConnection ejbRef;

    /**
    * Web service operation
    */
    @WebMethod(operationName = “daftarnilai”)
    public List getnilai() {
    //TODO write your implementation code here:

    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con= DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    }
    catch (Exception ex){
    System.out.println(ex.getMessage());
    }
    return list;
    }

    /**
    * Web service operation
    * @return
    */
    @WebMethod(operationName = “carinilai”)
    public String[] carinilai(@WebParam(name = “carinilai”)
    String ket) {
    String kurang = “kurang”;
    String cukup=”cukup”;
    String baik=”baik”;
    String memuaskan=”memuaskan”;
    DBConnection k = new DBConnection();
    ResultSet rs = null;
    if(ket.equalsIgnoreCase(kurang)){
    String sql = “select * from nilai where n_akhir =60 and n_akhir =75 and n_akhir =85 and n_akhir <=100";
    rs = k.getData(sql);

    }

    try {
    while (rs.next()) {
    data[0] = rs.getString(1);
    data[1] = rs.getString(2);
    data[2] = rs.getString(3);
    data[3] = rs.getString(4);
    data[4] = rs.getString(5);
    }
    } catch (SQLException ex) {
    Logger.getLogger(NilaiMahasiswa.class.getName()).log(Level.SEVERE, null, ex);
    }
    return data;
    }
    }

    Like

  13. Nama : Ibnu Salifi
    NIM :14.3.00024 (Genap)
    Kelas :TI.D3 (Malam)

    ***************************************************************************************

    package nilai.webservice;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import nilai.webservice.util.DBConnection;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;

    /**
    *
    * @author IBNU
    */
    @WebService(serviceName = “Nilai”)
    public class Nilai {
    private String[] data = new String[5];
    @EJB
    private DBConnection ejbRef;

    /**
    * Web service operation
    */
    @WebMethod(operationName = “nilaimahasiswa”)
    public List daftarnilai() {
    //TODO write your implementation code here:

    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/nilai_mahasiswa”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con= DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    }
    catch (Exception ex){
    System.out.println(ex.getMessage());
    }
    return list;
    }

    /**
    * Web service operation
    * @return
    */
    @WebMethod(operationName = “carinilaimahasiswa”)
    public String[] carinilaimahasiswa(@WebParam(name = “carinilaimahasiswa”)
    String ket) {
    String a = “kurang”;
    String b=”cukup”;
    String c=”baik”;
    String d=”memuaskan”;
    DBConnection k = new DBConnection();
    ResultSet rs = null;
    if(ket.equalsIgnoreCase(a)){
    String sql = “select * from nilai where n_akhir =60 and n_akhir =75 and n_akhir =85 and n_akhir <=100";
    rs = k.getData(sql);

    }

    try {
    while (rs.next()) {
    data[0] = rs.getString(1);
    data[1] = rs.getString(2);
    data[2] = rs.getString(3);
    data[3] = rs.getString(4);
    data[4] = rs.getString(5);
    }
    } catch (SQLException ex) {
    Logger.getLogger(Nilai.class.getName()).log(Level.SEVERE, null, ex);
    }
    return data;
    }
    }

    Like

  14. Bagas Arifin El Baroni
    14.3.00012
    ti d3 malam

    /*
    * 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 data.webservice;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import data.webservice.util.DBConnection;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;

    /**
    *
    * @author LL
    */
    @WebService(serviceName = “data”)
    public class data {
    private String[] data = new String[5];
    @EJB
    private DBConnection ejbRef;

    /**
    * Web service operation
    */
    @WebMethod(operationName = “datamahasiswa”)
    public List data() {
    //TODO write your implementation code here:

    List list = new ArrayList();
    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:3306/nilai_mahasiswa”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con= DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2)+”-“+rs.getString(3)+”-“+rs.getString(4)+”-“+rs.getString(5));
    con.close();
    }
    catch (Exception ex){
    System.out.println(ex.getMessage());
    }
    return list;
    }

    /**
    * Web service operation
    * @reaturn
    */
    @WebMethod(operationName = “caridatamahasiswa”)
    public String[] caridatamahasiswa(@WebParam(name = “caridatamahasiswa”)
    String ket) {
    String v = “kurang”;
    String w=”cukup”;
    String y=”baik”;
    String z=”memuaskan”;
    DBConnection k = new DBConnection();
    ResultSet rs = null;
    if(ket.equalsIgnoreCase(v)){
    String sql = “select * from nilai where n_akhir =60 and n_akhir =75 and n_akhir =85 and n_akhir <=100";
    rs = k.getData(sql);

    }

    try {
    while (rs.next()) {
    data[0] = rs.getString(1);
    data[1] = rs.getString(2);
    data[2] = rs.getString(3);
    data[3] = rs.getString(4);
    data[4] = rs.getString(5);
    }
    } catch (SQLException ex) {
    Logger.getLogger(Nilai.class.getName()).log(Level.SEVERE, null, ex);
    }
    return data;
    }
    }

    Like

  15. package koneksi;

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;

    /**
    *
    * @author ASUS
    */
    @Stateless
    public class Koneksi {
    public List nilaiMethod(){
    List list = new ArrayList();

    String JDBC_DRIVER=”com.mysql.jdbc.Driver”;
    String JDBC_URL=”jdbc:mysql://localhost:8080″+ “/nilai”;
    String USR=”root”;
    String PASS=””;

    try{
    Class.forName(JDBC_DRIVER);
    Connection con =
    DriverManager.getConnection(JDBC_URL,USR,PASS);
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(“select * from nilai”);
    while(rs.next())
    list.add(rs.getString(1)+”-“+rs.getString(2));
    con.close();
    }
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    return list;

    }
    }

    package com.server.tampil;

    import java.util.List;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import koneksi.Koneksi;

    /**
    *
    * @author ASUS
    */
    @WebService(serviceName = “TampilNilai”)
    public class TampilNilai {
    @EJB
    private Koneksi ejbRef;// Add business logic below. (Right-click in editor and choose
    // “Insert Code > Add Web Service Operation”)

    @WebMethod(operationName = “nilaiMethod”)
    public List nilaiMethod() {
    return ejbRef.nilaiMethod();
    }

    }

    Nama : Octavianto Adi Setiawan
    NIM : 14.3.00034 ( TI -D3)

    Like

  16. /*
    * 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 Koneksi2;

    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.PreparedStatement;
    import java.util.ArrayList;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;

    /**
    *
    * @author Janar
    */

    @WebService(serviceName = “tampil nilai”)
    public class menampilkan {

    Connection conn=null;
    PreparedStatement pstm=null;
    ResultSet rs=null;
    ConnectionMySQL connectSQL=new ConnectionMySQL();

    @WebMethod(operationName=”tampilNilai”)
    public ArrayList keterangan(@WebParam(name = “keterangan”) String keterangan){
    ArrayList NamaKolom = new ArrayList();
    try {
    conn=connectSQL.getConnect();
    if(keterangan.equals(“Kurang”))
    {
    pstm=conn.prepareStatement(“select NIM,Nama, Jurusan,Jenjang,n_akhir from nilai where n_akhir = 60 and n_akhir= 75 and n_akhir= 85 and n_akhir<100");
    }

    rs=pstm.executeQuery();
    while(rs.next()){
    NamaKolom NK =new NamaKolom();
    NK.setNIM(rs.getInt("NIM"));
    NK.setNama(rs.getString("Nama"));
    NK.setJurusan(rs.getString("Jurusan"));
    NK.setJenjang(rs.getString("Jenjang"));
    NK.setN_akhir(rs.getInt("n_akhir"));
    NamaKolom.add(NK);
    }
    }catch (Exception e){
    System.out.println("Gagal Tampil :"+e.toString());
    }return NamaKolom;
    }
    }

    Nama : Susilo Janar Eko
    NIM : 14500126

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s