Created
June 6, 2012 07:49
-
-
Save nugraha16/2880515 to your computer and use it in GitHub Desktop.
Hospitalization Information System applications with the SMS Gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package newbieilmu.rawatinap; | |
import javax.swing.*; | |
import java.sql.*; | |
public class Koneksi | |
{ | |
public Koneksi() | |
{ | |
} | |
public Connection open_a_Connection() throws SQLException | |
{ | |
Connection connect= null; | |
try | |
{ | |
Class.forName("com.mysql.jdbc.Driver"); | |
connect = DriverManager.getConnection("jdbc:mysql://localhost/db_rawatinap","root","root"); | |
return connect; | |
} | |
catch(SQLException ex) | |
{ | |
JOptionPane.showMessageDialog(null,"Tidak ada koneksi yang terbuka"+ ex,"informasi",JOptionPane.INFORMATION_MESSAGE); | |
return null; | |
} | |
catch(Exception e) | |
{ | |
JOptionPane.showMessageDialog(null,"Tidak dapat membuka koneksi yang terbuka","informasi",JOptionPane.INFORMATION_MESSAGE); | |
return null; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment