2017/05 3

이클립스 톰캣에서 mysql 연동

1. server.xml //이 줄은 기본으로 있을듯 * name="ABCD" 여기는 DB명이 아니고 연결 확인을 위한 이름 * 3306은 mysql 접속 기본 포트 * jdbc:mysql://IP주소:3306/데이터베이스명 ex) jdbc:mysql://127.0.0.1:3306/test_dev 2. web.xmlDB ConnectionABCD 잘은 모르겠지만.context.xml에 WEB-INF/web.xml이 부분이 있다면 web.xml에만 추가를 하고3번 context.xml은 수정하지 않아도 되는 것 같다. 4. DBConnection.java public class DBConnection {private static DataSource ds;private static final String s..

차근차근/SQL 2017.05.31

홈페이지 점검 후 수정하기 1

OWASP Top Ten Project 를 사용해서 1차 점검을 해봤다. 위험도가 높은 것 한가지가 나왔다.Attack technique used for unauthorized execution of operating system commands. This attack is possible when an application accepts untrusted input to build operating system commands in an insecure manner involving improper data sanitization, and/or improper calling of external programs 검색어 : OS Command Injection https://www.owasp.org/in..

oracle -> mysql 변경 에러 1

jsp 프로젝트 두개에서 사용중인 오라클을 mysql 로 바꿔야 한다.에러가 많이 나올 것 같아서.. 적기 시작. DB연동 1. 오라클 - 기존public static Connection getConnection() throws Exception { Connection con=null; try { Context initCtx = new InitialContext();Context envCtx = (Context) initCtx.lookup("java:comp/env");ds = (DataSource) envCtx.lookup(sDsName);con= ds.getConnection(); } catch (NamingException ne) { System.out.println(ne); } return con..

차근차근/SQL 2017.05.18
반응형