JDBC(3)
-
My batis2
HashMap List list= service.selectAllHashmap(); System.out.println(list); for (HashMap dept : list) { BigDecimal dno = (BigDecimal) dept.get("DEPTNO");//숫자 BigDecimal형태 저장 int deptno= dno.intValue(); String dname= (String) dept.get("DNAME"); String loc=(String) dept.get("LOC"); System.out.println(deptno+"\t"+dname+"\t"+loc); } System.out.println("======================================="); for (Ha..
2023.12.23 -
My Batis
JDBC_MyBatis_Ver_3 import com.dto.Dept; import com.service.OracleMyBatisService; public class OralceMyBatisMain { public static void main(String[] args) { //SqlSession sess = MySqlSessionFactory.getSqlSession(); //System.out.println(sess); OracleMyBatisService service = new OracleMyBatisService(); //int num = service.update(new Dept(99, "영업","서울")); //System.out.println("update 갯수 : "+num); Dept..
2023.12.19 -
JDBC
오라클 데이터베이스 연동을 위한 4가지 정보를 저장 String driver =”oracle.jdbc.drtiver.OracleDriver”; String url =”jdbc:oracle:thin:@localhost:1521:xe”; String userid =”scott”; String passwd =”tiger”; 2. 드라이버 로딩 Class.forName(driver); 3. Connection 맺기 Connection con = DriverManager.getConnection (url, userid, passwd); 4. SQL문 작성 String query = “SELECT deptno, dname, loc form dept”; 또는 String query = “DELETE FROM dept..
2023.12.14