Page 767 - 3-2
P. 767

if(how==0)
                                    {
                            GpioExample.state=1;
                                            mf = new MainFrame();
                                    }
                            }
                            else
                            {


                                    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;
            / / h t t p : / / w w w . t u t o r i a l s p o i n t . c o m / j d b c / j d b c - s a m p l e - c o d e . h t 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


                                                         - 767 -
   762   763   764   765   766   767   768   769   770   771   772