JAVA
-
191020 JDBC 기본JAVA 2020. 10. 19. 08:40
JDBC 기본 코드. 밑에 나타난 것은 어댑터와 같이 모든 형태의 DB와 JAVA를 연결하기 위한 장치이다. public List getEntPrograms() { Class.forName("Drvier.name"); Connection conn = DriverManager.getConnection("url","ID", "PW"); //1. Statement 이용 Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); //2. PreparedStatement 이용 PreparedStatement pstmt = conn.prepareStatement(sql); ResultSet rs = pstmt.updateQuery(..
-
161020 시험JAVA 2020. 10. 16. 12:46
DCL, DML, DDL, TCL 등등, 작성을 할 줄 알아야 한다. DML : Data Manipulation Language, 조작어 //select select * from emp ; //insert INSERT INTO CLIENT (c_no, c_name, c_tel, c_email) VALUES (000001, '손흥민', '01012341234', 'hmson123@naver.com'); //update UPDATE C_TABLE SET c_name='음바페', c_tel='01043214321' WHERE c_no = '000006'; //delete DELETE FROM C_TABLE WHERE c_no='000003'; DDL : Data Definition Language, 정의어 /..
-
190820 JSONReaderJAVA 2020. 8. 29. 15:19
JSONReader package test.lotto; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; public class JsonReader { public JSONObject connecti..
-
190820 lottoJAVA 2020. 8. 29. 15:13
Lotto package test.lotto; import java.awt.Color; import java.awt.Container; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.InputMismatchException; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import org.json.simple.JSONObj..
-
190820 - get Lotto NumJAVA 2020. 8. 29. 15:12
get Lotto Num package test.lotto; import java.awt.Color; import java.awt.Container; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; public class getLottoNum extends JFrame implements KeyListener, Mouse..