package miniveritabani;

import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;

public class MiniVeritabani {


public static void main(String[] args) throws ClassNotFoundException, SQLException {
String kno=JOptionPane.showInputDialog("Ogrenci no girin");
String ad=JOptionPane.showInputDialog("Ogrenci adi");
String soyad=JOptionPane.showInputDialog("Ogrenci soyadi");
String tel=JOptionPane.showInputDialog("Ogrenci tel");

Class.forName("com.mysql.jdbc.Driver");
Connection baglanti=DriverManager.getConnection("jdbc:mysql://localhost:3306/spor", "root", "");

Statement ifade=baglanti.createStatement();

ifade.executeUpdate("insert into yuzme(kno,ad,soyad,tel)" +" values('"+kno+"','"+ad+"','"+soyad+"','"+tel+"')");

//ifade.executeUpdate("update yuzme set ad='Mehmet Ethem' where kno='0705040332'");
//ifade.execute("delete from yuzme where kno='050403028'");

}



}

 

Not : ------------------------------------------------------------------------------------------------------------------------

Bu çalışma netbeans üzeinde denendi çalıştı.

Okul Zil Programı

yilsoftzil

9786059223690
logo5

Esma-ül Hüsna

Ziyaretçi İstatistikleri

Bugün181
Dün366
Bu hafta1758
Bu ay7267
Hepsi810485