/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sinif;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;


public class veritabani_baglanti 
{   
    private String url = "jdbc:mysql://localhost:3306/";
    private String driver = "com.mysql.jdbc.Driver";
    private String dbname = "alisveris";
    private String userName = "root";
    private String password = "";
    
    public Connection con;
    
    public void baglan()
    {
        try 
        {
            Class.forName(driver).newInstance();
            con = DriverManager.getConnection(url+dbname,userName,password);
        } 
        catch (Exception ex) 
        {
            JOptionPane.showMessageDialog(null, "Hata :"+ex);
        }
    }
    
}
