1 / 13

Mengakses Database dg JDBC

Mengakses Database dg JDBC. Tujuan. Mengetahui. Dasar-dasar Database. Database adalah kumpulan data yang disimpan secara terstruktur . Database Management System (DBMS) merupakan software pengelola database. Antara lain : MySQL PostgreSQL Oracle, dll Macam-macam database :

mead
Télécharger la présentation

Mengakses Database dg JDBC

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. Mengakses Database dg JDBC

  2. Tujuan • Mengetahui

  3. Dasar-dasar Database • Database adalahkumpulan data yang disimpansecaraterstruktur. • Database Management System (DBMS) merupakan software pengelola database. Antara lain : • MySQL • PostgreSQL • Oracle, dll • Macam-macam database : • Object-oriented database • Relational database, dll

  4. Structured Query Language (SQL) • Sebuah database umumnyatersusunatastabel-tabel • SQL merupakanbahasauntukmengelola database. • Perintahuntukmengakses data di database diistilahkandengan query. Contoh query : insert into tuser (usernama,password) values (‘heidy’, ‘123456’); select password from tuser where username=‘heidy’;

  5. ContohTabel pd Relational Database atribut record

  6. SQL Query Keyword

  7. Dasarperintah SELECT • Rumus : SELECT * FROM tableName • Contoh : • SELECT * FROM tuser; • SELECT * FROM tuser where id=1; • SELECT usernameFROM tuser; • SELECT * FROM tuser order by nim ASC;

  8. Dasarperintah INSERT • Rumus : INSERT INTO tableName(columnName1, columnName2, ..., columnNameN )VALUES ( value1, value2, ..., valueN ) • Contoh : • INSERT INTO tuser (username, password) VALUES (‘hana’, ‘1234’);

  9. DasarPerintah UPDATE • Rumus : UPDATE tableNameSETcolumnName1 = value1, columnName2 = value2, ..., columnNameN = valueNWHERE criteria • Contoh : • UPDATE tuser SET password = ‘7777’ WHERE username=‘hana’;

  10. DasarPerintahDELETE • Rumus : DELETE FROM tableName WHERE criteria • Contoh : • DELETE FROM tuser WHERE id=1; • DELETE FROM tuser;

  11. Koneksi Java keMySQL • Menggunakan software tambahan, yaitu Java-MySQL connector. • Library yang digunakan Java Database Connectivity (JDBC).

  12. Contoh

More Related