본문 바로가기

프로그래밍

(18)
getClient IP public static String getClientIpAddr(HttpServletRequest request) { String ip = request.getHeader("X-Forwarded-For"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unkno..
MySQL 기본적인 모니터링 방법과 Connection과 Memory 튜닝 방법 MySQL Database의 경우 Oracle 이나 MS SQL Server에 비해서 대용량의 자료를 처리하는 경우가 적기에 튜닝에 필요성이 적은 것 같습니다. 그러나 웹이라는 환경은 많은 사용자가 동시에 접속을 할 수 있기에 항상 모니터링과 최적화는 기본이라고 생각합니다. 본 강좌에서는 기본적인 모니터링 방법과 Connection과 Memory 부분에 대한 튜닝 방법을 소개하도록 하겠습니다. 가. 모니터링 및 초기화 명령어 show status - MySQL 데이타베이스의 현재 상황 show Processlist - MySQL 프로세스 목록 show variables - 설정 가능한 모든 변수 목록 flush logs - MySQL의 로그파일 초기화 flush status - MySQL 상태정보 초기화..
Running a syntax check on /etc/my.cnf Usually, I update variables on the fly using something like: mysql> SET GLOBAL max_connections = 150; … and then modify /etc/my.cnf to make the change persistent. The problem in doing this is that you’re not verifying that your /etc/my.cnf is correct and can only hope that a restart doesn’t encounter any problems. Fortunately, Sai emailed us a great little tip to verify the syntax. You can run t..
mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead [duplicate] Simply put, you need to rewrite all of your database connections and queries. You are using mysql_* functions which are now deprecated and will be removed from PHP in the future. So you need to start using MySQLi or PDO instead, just as the error notice warned you. A basic example of using PDO (without error handling):
Implementing HTTP byte-range requests in Spring MVC 파일 이어받기 서버측 구현 물론 아래 소스를 복사하여 붙여넣은뒤, 자신의 시스템에 맞게 커스텀마이징 해주셔야 합니다... /** * net/balusc/webapp/FileServlet.java * * Copyright (C) 2009 BalusC * * This program is free software: you can redistribute it and/or modify it under the terms of the * GNU Lesser General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * This library is..
MYSQL에서 랜덤으로 데이터 읽어오기 예) select * from table_name order by rand() limit 10 ; 위에서 table_name 에는 자신이 랜덤으로 데이터를 뽑을 테이블의 이름이며 10은 자신이 랜덤으로 몇개의 데이터를 뽑을것인지 쓰는 곳이다. 예를들어 자신이 aaa라는 테이블에서 7개의 임의의 데이터를 읽어오려면 select * from aaa order by rand() limit 7 ; 라고 쓰면 된다.
[jstl]숫자뒤에 .0 붙이기 int to double
[jstl] 숫자 천단위마다 콤마 찍어 구분 숫자 천단위마다 콤마 찍어 구분 금액 표시 날짜 표시