Page 387 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 387
인천전자마이스터고 전자회로설계과
int how = JOptionPane.showConfirmDialog(this,"반납하시겠습니
까?","반납", JOptionPane.YES_NO_OPTION);
if(how==0)
{
GpioExample.state=2;
mf = new MainFrame();
}
}
}
}
< DataBase.java >
package com.example.user.appclient;
// htt p:/ /ww w.t uto ria lsp oin t.c om/ jdb c/j dbc -sa mpl e-c ode .ht m
//http://www.tutorialspoint.com/jdbc/jdbc-db-connections.htm
import java.sql.*;
public class Database {
// JDBC driver name and database URL
static final String JDBC_DRIVER = "myspl_con.src.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://raspberrypi/rainism";
// Database credentials
static final String USER = "root";
static final String PASS = "raspberry";
static String phone;
static boolean flag=true;
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
try{
//STEP 2: Register JDBC driver
Class.forName("myspl_con.src.com.mysql.jdbc.Driver");
//STEP 3: Open a connection
- 380 -