1 / 12

Database Connectivity

Database Connectivity. Nama Anggota Kelompok : Marina KW (10.41010.0118) Robby Cahyadi (10.41010.0119) Asdi Atmin F (10.41010.0120) Refi Zulkarami (10.41010.0121). Pengertian.

winda
Download Presentation

Database Connectivity

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database Connectivity

  2. NamaAnggotaKelompok : • Marina KW (10.41010.0118) • Robby Cahyadi (10.41010.0119) • AsdiAtmin F (10.41010.0120) • RefiZulkarami (10.41010.0121)

  3. Pengertian Open Database Connectivity (disingkatmenjadi ODBC) adalahsebuahstandarterbukauntukkonektivitasantarmesin basis data. StandarinimenyediakanApplication Programming Interface (API) yang dapatdigunakanuntukmenjalankandanmengoneksikansebuahaplikasidengansebuahsistemmanajemen basis data (SMBD). Para desainer ODBC membuatnyadengantujuan agar ODBC terbebasdaripenggunaanbahasapemrogramantertentu, sistemmanajemen basis data tertentu, dansistemoperasitertentu.

  4. Komponen ODBC • ODBC API: sekumpulanpanggilanfungsi, kode-kodekesalahandansintaksis SQL yang mendefinisikanbagaimana data dalamsebuah DBMS diakses. • Driver basis data ODBC: driver (yang berupa dynamic link library) yang mampumemprosespanggilanfungsi ODBC untuksebuah DBMS tertentu. • ODBC Driver Manager: yang bertugasuntukmemuat driver basis data ODBC yang dibutuhkanolehaplikasi.

  5. Pustakainti ODBC, yang bersifatindependenterhadapaplikasidanjuga DBMS, bertindaksebagai interpreter antaraaplikasidanjuga driver basis data, sementara driver basis data mengandung detail-detail mengenai SMBD tertentu. Sehingga, dengancarasepertiini, para programmer dapatmenulisaplikasi basis data, tanpaharusmemahamisistemmanajemen basis data tertentu, mengingatsemuanyatelahditanganioleh ODBC. Akan tetapi, parapembuat driver basis data ODBC hanyaharusmengetahuibagaimanacaranyamemasukkan driver basis data kedalampustakainti ODBC. Denganbegitu, ODBC inidapatdisebutsebagaisistem yang modular.

  6. Contoh connectivity :

  7. Java Database Connectivity (JDBC) JDBC merupakanbagiandariteknologi Java yang ditujukanuntukberkomunikasidengan DBMS. Baikitu MySQL, Oracle, Sybase, PostgreSQLdan DBMS lainnya. 

  8. ContohDataBase Connectivity Koneksi Java keMysql public KoneksiDB(String host, String user, String pass) { localhost=host; username=user; password=pass; try{ Class.forName("org.gjt.mm.mysql.Driver"); conn=DriverManager.getConnection("jdbc:mysql://"+localhost+"/pegawai", username, password); state=conn.createStatement(); }catch(Exception e){ e.printStackTrace(); } }

  9. ContohDataBase Connectivity Koneksi PHP keMysql <?php $host="localhost"; $username="root"; $password=“123456"; $databasename="dbkaryawan"; $link=mysql_connect($host,$username,$password) or die ("Database tidakdapatdihubungkan!"); mysql_select_db($databasename,$link); ?>

  10. ContohDataBase Connectivity Koneksi JAVA ke ORACLE importjava.sql.*; public class koneksi_database { String db = "jdbc:oracle:thin:@localhost:1521:XE"; String user = "sys"; String pass = "bismillah"; Connection c = null; Statement s = null; public koneksi_database(){} public Statement koneksi(){ try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); }

  11. ContohDataBase Connectivity Koneksi JAVA ke ORACLE (lanjutan….) try { c = DriverManager.getConnection(db,user,pass); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { s = c.createStatement(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return s; } }

  12. Sekian Dan Terima Kasih

More Related