Nggawe IDEA
Intellij IDEA ngerti carane nggarap database ora luwih ala tinimbang Workbench. Malah duwe tab Database khusus ing panel tengen. Yen sampeyan ngeklik, sampeyan bakal weruh gambar:
![](https://cdn.codegym.cc/images/article/7e1904c9-2653-4acd-9740-62964d202ea6/1024.jpeg)
Ayo nyoba nyambung menyang database kita. Kanggo miwiti, klik tandha plus:
![](https://cdn.codegym.cc/images/article/26c67ffd-1e96-4650-99e4-d9a4a15f8249/1024.jpeg)
Kepiye sampeyan seneng dhaptar database sing didhukung? Nyengsemaken? Miwiti saka Google Big Query lan dipungkasi karo Cassandra.
Nyambungake MySQL IDEA
Nanging kita wong sing andhap asor, dadi kita bakal milih MySQL. IDEA langsung nyaranake nemtokake setelan kanggo nyambungake menyang database:
![](https://cdn.codegym.cc/images/article/cf9b7fa6-1198-4e87-bf2f-4f43bc84ff36/800.jpeg)
Malah ana luwih akeh tinimbang Workbench. Sanajan kabeh sing dibutuhake wis dituduhake, bisa uga ora ana login lan sandhi.
Saka sing menarik: IDEA ditulis ing Jawa, mula nggunakake driver Java standar kanggo nggarap MySQL. Yaiku, persis sing bakal digunakake program kita nalika ngirim pitakon menyang server MySQL.
Mula, aja ragu-ragu klik Download kanggo ndownload driver sing ilang.
Aku uga nemtokake login lan sandhi menyang server lokal kita banjur ngeklik tombol Sambungan Tes:
![](https://cdn.codegym.cc/images/article/10d72907-db21-47a0-9120-79562df540c8/800.jpeg)
Sambungan kasebut kasil digawe, mula klik OK.
Nampilake isi database
Yen sampeyan ndeleng gambar iki:
![](https://cdn.codegym.cc/images/article/37300b8f-66ba-4007-8813-89a06dceb6fc/1024.jpeg)
Banjur klik ing panggonan sing disorot abang lan pilih dhaptar skema kanthi manual. Aku nemtokake 3: test, test2 lan supershop lan iki sing dakdeleng saiki:
![](https://cdn.codegym.cc/images/article/259904ac-d632-441a-9d5f-fbd9d0b38544/1024.jpeg)
Kabeh telung diagramku wis ana. Ayo ndeleng apa sing ana ing tabel pangguna:
![](https://cdn.codegym.cc/images/article/0580417a-caee-42b3-8103-0055db36a6bd/1024.jpeg)
Ya, aku wis ngerti apa kolom sing ana, nanging kepiye carane ndeleng data kasebut?
Tampilake isi tabel
Aku mung klik kaping pindho ing jeneng tabel lan IDEA nuduhake kula iki:
![](https://cdn.codegym.cc/images/article/01c314f3-2f57-45a7-a2ac-71332bb06dd3/1024.jpeg)
Nganti saiki, katon luwih menarik tinimbang ing Workbench. Data kasebut langsung ditampilake, lan uga ana kolom layanan WHERE lan ORDER BY. Supaya sampeyan bisa nyaring lan ngurutake data langsung ing papan kasebut.
Ayo nyoba ngurutake tabel miturut level ...
Sanalika aku miwiti nulis level tembung, IDEA langsung menehi dhaptar pitunjuk sing apik:
![](https://cdn.codegym.cc/images/article/11897f5a-5a52-4945-a7e1-056737ab72db/1024.jpeg)
Mbok katon luwih menarik tinimbang nggarap Workbench, dheweke ora menehi pitunjuk khusus.
Aku ngetik level, tekan enter, lan voila, tabel diurutake:
![](https://cdn.codegym.cc/images/article/d28c3376-44fe-4834-9a33-ae3e01ea9a25/1024.jpeg)
Oke, saiki aku pengin nglakokake pitakon sewenang-wenang tanpa ngiket tabel, ing ngendi aku bisa nindakake?
Kita bali menyang panel ing sisih tengen - ana tombol khusus kanggo mbukak Query Console:
![](https://cdn.codegym.cc/images/article/d162e79a-bcb5-42ae-9a8e-9ea764a86929/1024.jpeg)
Lan kita miwiti nulis pitakon:
![](https://cdn.codegym.cc/images/article/abcc2597-15ff-4389-9755-4ae84fa24548/1024.jpeg)
Tip otomatis saka IDEA, kaya biasane, ing ndhuwur . Lan iki minangka asil pitakon kita:
![](https://cdn.codegym.cc/images/article/61ea88b1-dd75-4e98-8b91-9b6c5f43b9d4/1024.jpeg)