Jika anda masih kebingungan bagaimana membuat file KONEKSI.jsp di java dengan menggunakan netbeans, berikut saya kasih scriptnya.. Selamat mencoba
<%@ page import="java.sql.*" %>
<%
//Connection ab=null;
Connection con=null;
String dbname="jdbc:mysql://localhost:3306/inventori?user=root&password=";
String status="";
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection(dbname);
if(con==null)
status = "gagal";
else
status = "berhasil";
}catch(ClassNotFoundException ex) {
status = "Driver Error";
}catch(SQLException ex) {
status = "gagal";
}
//con.close();
%>
No comments:
Post a Comment