2018/11/21 4

java - console에 DB데이터 출력(행갯수, 열갯수, 열제목, 데이터), ResultSetMetaData

package com.example.jdbc; import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.Statement; public class JDBCConsole { public static void main(String[] args) {String url = "jdbc:h2:tcp://localhost/~/mydb";String user = "sa";String pwd = "";Connection con = null;Statement stmt = null;ResultS..

IT/Java 2018.11.21

java - url을 통해 가져온 데이터를 DOMParser로 파싱, JSONParser로 파싱

CompanyHandler.javapackage com.example.xml; import java.util.ArrayList;import java.util.List; import org.xml.sax.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler; public class CompanyHandler extends DefaultHandler { private List list = new ArrayList();private Company company;private StringBuilder sb = new StringBuilder();@Overridepublic void startElement(Strin..

IT/Java 2018.11.21