package com.stripbandunk.database.statement;
import com.stripbandunk.database.util.DatabaseUtil;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author echo
*/
public class Program {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Connection koneksi = DatabaseUtil.getKoneksi();
Statement statement = null;
try{
statement = koneksi.createStatement();
System.out.println("Statement berhasil dibuat");
//
}catch(SQLException ex){
System.out.println("Statement gagal dibuat");
}finally{
if(statement != null){
try{
statement.close();
System.out.println("Berhasil menutup statement");
}catch(SQLException ex){
System.out.println("Gagal menutup statement");
}
}
}
}
}
import com.stripbandunk.database.util.DatabaseUtil;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author echo
*/
public class Program {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Connection koneksi = DatabaseUtil.getKoneksi();
Statement statement = null;
try{
statement = koneksi.createStatement();
System.out.println("Statement berhasil dibuat");
//
}catch(SQLException ex){
System.out.println("Statement gagal dibuat");
}finally{
if(statement != null){
try{
statement.close();
System.out.println("Berhasil menutup statement");
}catch(SQLException ex){
System.out.println("Gagal menutup statement");
}
}
}
}
}