Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Guesuper Guesuper is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 408
Rep Power: 14
Guesuper mempunyai hidup yang Normal
Default [Help] Form netbeans oracle,,,,

Permisi para agan2 semua ,,,,



Quote:





Sekarang ini ane kan lagi buat program penjualan pake netbeans ama databasenya oracle, ane udah buat beberapa form master kayak data barang, data member ama data supplier udah bisa konek n bisa insert, update, delete ke database oraclenya, lha pas ane buat form penjualannya eh kok g bisa simpen datanya ya, malah primary key dianggap ganda terus padahal ane baru mau nyimpen data barupadahal tuk update ama deletenya bisa,,,





biar g bingung ane kasih skrinsutnya




Spoiler for penampakan:














nih juga sintaksnya tuk fungsi insert/simpan


Spoiler for coding:





Quote:





if(txtbeli.getText().equals("")){

new kosong().setVisible(true);

} else {





try {

Connection con = DriverManager.getConnection("jdbcracle:thin:@127 .0.0.1:1521:XE", "satria", "a123bc");

Statement stmt = con.createStatement();

String SQL = "INSERT INTO penjualan VALUES ('" + txtbeli.getText() + "'," + "'" + txtnsup.getText() + "'," + "'" + txttgl.getText() + "'," + "'" + txttotal.getText() + "'," + "'" + txtbayar.getText() + "')";

stmt.executeUpdate(SQL);



stmt.close();

con.close();



txtbeli.setText("");

txtnsup.setText("");

txttgl.setText("");

txttotal.setText("");

txtbayar.setText("");





} catch (SQLException e) {

}



}

new ganda().setVisible(true);















Ane mohon saran n pencerahannya dari agan2 master semua



Ane ucapin terimaksih atas bantuannya para agan2 semua ,,,,



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 10:44 PM.


no new posts