2009년 7월 31일 금요일

Text 최대입력 길이 후 focus이동

<input type="Text" maxlength="6" onkeyup="checkLen(this)">

//////////////////////////////////////////////////

function checkLen(x)
 {
  if (x.value.length==x.maxLength)
    {
     var xf=x.form
     for (var i=0;i<xf.length;i++)
     {
      if(x==xf.elements[i])
      {
         xf.elements[i+1].focus();
         return;
      }
     }
    }
 }

///////////////////////////////////////////////

입력창에서 입력글짜가 최대설정길이에 도달시

부모 폼 중에서 다음 콤포넌트로 포커스 이동

2009.7.31 yang.nam.seok

2009년 7월 30일 목요일

이클립스 단축키 리스트

단축키 리스트

HELP->Help Contents->Java Development User Guide->Reference->JDT Basics

내용 단축키
전체화면 토글   CTRL + M 
한줄(블럭) 복사   Ctrl + Alt + 위(아래) 
새로만들기   Ctrl + N
메소드나 필드 이동   CTRL + O 
페이지 이동   CTRL + E 
CTRL+TAB 기능   CTRL + F6 
VIEW이동   CTRL + F7 
Perspective 이동   CTRL + F8
들여쓰기 자동 수정   CTRL + I 
위(아래)줄과 바꾸기   ALT + UP(DOWN) 
블록 선택   ALT + SHIFT + 방향키 
메소드의 파라미터 목록 보기.  CTRL + SHIFT + SPACE
자동 import   CTRL + SHIFT + O 
블록 주석(/*..*/)   CTRL + SHIFT + / 
블록주석제거   CTRL + SHIFT + \
한줄 삭제   CTRL + D
다음 annotation 점프   Ctrl + 
퀵 픽스   Ctrl + 1
메소드 정의부로 이동   F3
하이어라키   Ctrl + T
다음찾기   Ctrl + K
이전찾기   Ctrl + SHIFT + K
저장   Ctrl + S
모두저장   Ctrl + Shift  + S
닫기   Ctrl + F4
모두 닫기   CTRL + SHIFT + F4
파일 닫기   CTRL + W 

 

* Alt
    > Alt + Shift + J : JavaDoc 주석
    > Alt + ←→(좌/우) : 뷰 화면의 탭에 열린 페이지 이동
    > Alt + ↑↓(상/하) : 커서가 있는 줄을 위 아래로 이동

* Ctrl
    > Ctrl + 1 : Quick Fix
        >> 구현하지 않은 메소드 추가
        >> 로컬 변수 이름 바꾸기
        >> Assignment 입력
        >> 행 둘러싸기 (if/where/for이나 블록으로 둘러 싸려면 해당영역을 선택하고 Ctrl + 1)
    > Ctrl + D : 한줄 삭제
    > Ctrl + E : 뷰 화면의 탭에 열린 페이지 이동
    > Ctrl + L : 라인 이동
    > Ctrl + I : 자동 들여쓰기 수정
    > Ctrl + K : 문자열 찾기 (찾고자 하는 문자열을 블럭으로 설정한 후...)
        >> Ctrl + Shift + K : 역순으로 찾기
    > Ctrl + M : 전체화면
    > Ctrl + O : 현재 보고있는 파일의 아웃라인 (메소드 리스트 확인, 메소드나 필드 이동가능)
    > Ctrl + W : 창 닫기
    > Ctrl + , or. : 다음 Annotation(Error, Warning, Bookmark)으로 이동
    > Ctrl + / : 주석 처리 (여러줄 블럭 처리 가능)

    > Ctrl + Alt + ↑↓(상/하) : 한줄(블럭) 복사

    > Ctrl + Shift + E : Switch to Editor (탭에 열려있는 Editor 이동)
    > Ctrl + Shift + G : 클래스의 메소드나 필드를 Reference하고 있는 곳으로 이동
        >> 반대 : F3 (Reference하는 클래스로 이동)
    > Ctrl + Shift + L : 단축키 보기
        >> Ctrl + Shift + L + L : 단축키 지정
    > Ctrl + Shift + W : 열린 파일 모두 닫기
    > Ctrl + Shift + O : 자동 import 처리 (사용하지 않는 Class는 삭제)
    > Ctrl + Shift + R : Open Resource
    > Ctrl + Shift + ↑↓(상/하) : 다음/이전 메소드로 이동
    > Ctrl + Shift + / :JavaDoc주석 추가
    > Ctrl + Shift + Space : 메소드 파라미터 힌트 (메소드에 입력해야 하는 파라미터 정보가 표시된다.)

    > Ctrl + F3 : 클래스 아웃라인
    > Ctrl + F6 : View 화면의 탭에 열린 페이지 이동
    > Ctrl + F7 : View간 화면 전환
    > Ctrl + F8 : Perspective간 화면 전환
    > Ctrl + F11 : 바로 전에 실행했던 클래스 실행
    > Ctrl + PageDown : 뷰 화면의 탭에 열린 페이지 이동

* Function Key
    > F2 : 에러의 원인에 대한 힌트 (에러 라인에 커서를 위치시키고...)
    > F3 : Java 편집기에서 Reference하는 클래스의 자바파일로 이동
        >> Ctrl + 클릭
        >> 반대 : Ctrl + Shift + G (클래스의 메소드나 필드를 Reference하고 있는 곳으로 이동)
    > F4 : 해당 클래스의 Hierarchy
    > F12 : Editor로 포커스

* E.T.C.
    > CTRL + 휠 : 페이지 단위 이동

window.open 속성 사용 방법

<script type="text/javascript">

/*
window.open(url:String, name:String, properties:String)
open
함수는 반드시 3개의 매개변수가 있고, 매개변수 순서는 지켜야 함.
name
은 팝업창의 이름, 주로 프레임 문서의 Target으로 사용

name
은 사용하지 않으려면 " " 만 표시해줍니다. 반드시 표시해야 함.
*/


function win() {
window.open("http://eschyles.mireene.com/", "", "");  //
속성 지정하지 않은 기본창

}


function menu_win() {
window.open("http://eschyles.mireene.com/", "", "menubar=1");  //
메뉴바 없는 팝업
}


function full_win() {
window.open("http://eschyles.mireene.com/", "", "fullscreen"); //
풀스크린 방식
}

function channel_win() {
window.open("http://eschyles.mireene.com/", "", "channelmode"); //
채널모드

}


function status_win() { //
상태표시바 있는 팝업
window.open("http://eschyles.mireene.com/", "", "width=400, height=300, status=1");
}


function popup_win1() { //
크기 width400 height300 팝업창
window.open("http://eschyles.mireene.com/", "", "width=400, height=300");
}


function popup_win2() { //
위치 left=500, top=400 에서 열리는 팝업창
window.open("http://eschyles.mireene.com/", "", "width=400, height=300, left=500, top=400");
}


function popup_win3() { //
스크롤바 있는 팝업
window.open("http://eschyles.mireene.com/", "", "width=400, height=300,  scrollbars=1");
}


function popup_win4() { //
주소표시줄 있는 팝업
window.open("http://eschyles.mireene.com/", "", "width=400, height=300, left=100, location=1");
}
</script>


<body>
<input type="button" value="
속성 지정하지 않은 기본 창" onclick="win()">

<input type="button" value="
메뉴바 없는 팝업
" onclick="menu_win()">

<input type="button" value="
풀스크린 팝업
" onclick="full_win()">

<input type="button" value="
채널모드 팝업
" onclick="channel_win()">

<input type="button" value="
상태표시바 있는 팝업
" onclick="status_win()">

<input type="button" value="width400 height300
팝업창
" onclick="popup_win1()">

<input type="button" value="
위치 left=500, top=400 팝업창
" onclick="popup_win2()">

<input type="button" value="
스크롤바 있는 팝업
" onclick="popup_win3()">

<input type="button" value="
주소 입력 표시줄 있는 팝업
" onclick="popup_win4()">

</body>

CSS RollOver

<HTML>

<HEAD>
<TITLE> CSS RollOver </TITLE>
</HEAD>
 
<BODY>
 
<style>

   a.rollover img { border-width:0px; display:inline; }
   a.rollover img.over { display:none; }
 
   a.rollover:hover { border:0px }
   a.rollover:hover img { display:none; }
   a.rollover:hover img.over { display:inline; }

</style>
 
<div class="rollover">
   <a href="#test" class="rollover"><img src="http://www.blueb.co.kr/bbs/table/JS_50/upload/s_blue.gif"><img src="http://www.blueb.co.kr/bbs/table/JS_50/upload/s_yellow.gif" class="over"></a>
   <a href="#test" class="rollover"><img src="http://www.blueb.co.kr/bbs/table/JS_50/upload/s_red.gif"><img src="http://www.blueb.co.kr/bbs/table/JS_50/upload/s_green.gif" class="over"></a>
</div>

</BODY>

</HTML>

2009년 7월 29일 수요일

javascript trim구현하기

 <script>
     function check() {
          if (document.post.subject.value.trim()==""){
             alert("내용을 입력해 주세요.");
             document.post.content.focus();
          return;
     }
     document.post.submit();
 }
 
    String.prototype.trim = function() {
         return this.replace(/(^\s*)|(\s*$)/gi, "");
    }

</script>

 

2009년 7월 28일 화요일

클래스패스의 리소스 사용법

웹 애플리케이션은 보통 애플리케이션의 설정을 담고 있는 파일이 필요하다. web.xml, struts-config.xml 등의 설정 파일들은 보통 웹 애플리케이션의 /WEB-INF/에 위치하게 되는데 그 외에 애플리케이션에서 사용하는 파일들은 어디에 놓고 사용하는 것이 편리할까? 가장 관리하기 쉽고 부가적인 작업이 적은 방법은 클래스패스에 두는 것이다. /WEB-INF/classes에 두면 자바의 클래스로더를 이용해서 이런 파일들에 접근할 수 있다. log4j 등 많은 라이브러리들이 자신의 설정 파일을 클래스패스에서 가장 먼저 찾게 된다.

 

    public File getFile(String name) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        return new File(loader.getResource(name).getFile());
    }

    public void doSomeProcess() {
        File file = getFile("config.xml");
    }

 

 

http://youngrok.com/wiki/wiki.php/%C0%DA%B9%D9%C0%A5%C7%C1%B7%CE%B1%D7%B7%A1%B8%D3%C0%C7%B1%E2%BA%BB#s-4.2.7

properties 파일 상대경로 설정하기

properties 파일의 경로를 설정하는 방법

 

request.getRealPath("/")  를 이용해서 경로를 구한뒤 그 뒤에 문자열을 붙여서 처리

 

String file = request.getRealPath("/")+"WEB-INF/db.properties";

2009년 7월 25일 토요일

PicPick Tools

PicPick is an all-in-one software for software developers, graphic designers and home user.

It has an intuitive interface and simple, elegant operation. After starting the software, you simply select one of the tool from the PicPick Tools trayicon menu when you want.

It features a powerful capture tool, image editor, color picker, color palette, pixel ruler, protractor, crosshair, whiteboard and etc. You can use all these tools freely.......

http://picpick.wiziple.net/

javascript 날짜 팁

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>

<script language="javascript">


 function dateCal1()
 {
  var form=document.frm;
  //1970.01.01 날짜 계산이 시작되는 기준일
  var basic = new Date(0);

  //오늘날짜
  var nowdate= new Date();
 
  var count=Number(form.count.value);

  //1000*60*60*24 는 하루
  var daytime=1000*60*60*24;
  var lastday = new Date(( daytime * ( count + ( ( nowdate - basic ) / ( daytime ) ) ) ) );
  alert(lastday);
 }

 function dateCal2()
 {  
  var form=document.frm;
 
  //1000*60*60*24 는 하루
  var daytime = 1000*60*60*24;

  //시작일
  var startyear = form.startyear.value;
  var startmon  = form.startmon.value;
  var startdata = form.startdate.value;
  var start = new Date(startyear,startmon-1,startdata);

  // 마감일
  var endyear = form.endyear.value;
  var endmon  = form.endmon.value;
  var enddata = form.enddate.value;
  var end = new Date(endyear,endmon-1,enddata);

  // 시작일부터 마감일까지의 기간
  alert(1+(end-start)/daytime+"일");
 }
</script>

</head>
<body>
 <form name="frm">
  시작일
  <input type="text" name="startyear" value="2007">년
  <input type="text" name="startmon" value="1">월
  <input type="text" name="startdate" value="2">일
  <br>
  마감일
  <input type="text" name="endyear" value="2007">년
  <input type="text" name="endmon" value="1">월
  <input type="text" name="enddate" value="4">일
  <br>
  <input type="button" value="기 간" onclick="dateCal2();">
  <br>
  오늘부터<input type="text" name="count" value="4">
  <input type="button" value="일 후" onclick="dateCal1();">

 </form>
</body>
</html>

2009년 7월 24일 금요일

Java 파일 이어쓰기

 

BufferedWriter file = new BufferedWriter(new FileWriter("filename"));  

//파일을 덮어쓴다.

 

BufferedWriter file = new BufferedWriter(new FileWriter("filename", true));
//이 코드는 파일이 없으면 새로 만들고 있다면 덮어쓰지 않고 이어서 쓰게한다.

 

BufferedWriter를 통해서 개행문자사용

file.write(str, 0, str.length());
file.newLine();

Java 날짜 팁

시스템의 밀리초 구하기.(국제표준시각(UTC, GMT) 1970/1/1/0/0/0 으로부터 경과한 시각)
------------------------------------------------------------------
// 밀리초 단위(*1000은 1초), 음수이면 이전 시각
long time = System.currentTimeMillis ( );
System.out.println ( time.toString ( ) );
------------------------------------------------------------------

현재 시각을 가져오기
------------------------------------------------------------------
Date today = new Date ();
System.out.println ( today );

결과 : Sat Jul 12 16:03:00 GMT+01:00 2000
------------------------------------------------------------------

경과시간(초) 구하기
------------------------------------------------------------------
long time1 = System.currentTimeMillis ();
long time2 = System.currentTimeMillis ();
system.out.println ( ( time2 - time1 ) / 1000.0 );
------------------------------------------------------------------

Date를 Calendar로 맵핑시키기
------------------------------------------------------------------
Date d = new Date ( );
Calendar c = Calendar.getInstance ( );
c.setTime ( d );
------------------------------------------------------------------

날짜(년/월/일/시/분/초) 구하기
------------------------------------------------------------------
import java.util.*;
import java.text.*;

SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy.MM.dd HH:mm:ss", Locale.KOREA );
Date currentTime = new Date ( );
String dTime = formatter.format ( currentTime );
System.out.println ( dTime );
------------------------------------------------------------------

날짜(년/월/일/시/분/초) 구하기2
------------------------------------------------------------------
GregorianCalendar today = new GregorianCalendar ( );

int year = today.get ( today.YEAR );
int month = today.get ( today.MONTH ) + 1;
int yoil = today.get ( today.DAY_OF_MONTH );

GregorianCalendar gc = new GregorianCalendar ( );

System.out.println ( gc.get ( Calendar.YEAR ) );
System.out.println ( String.valueOf ( gc.get ( Calendar.MONTH ) + 1 ) );
System.out.println ( gc.get ( Calendar.DATE ) );
System.out.println ( gc.get ( DAY_OF_MONTH ) );
------------------------------------------------------------------

날짜(년/월/일/시/분/초) 구하기3
------------------------------------------------------------------
DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.KOREA);
Calendar cal = Calendar.getInstance(Locale.KOREA);
nal = df.format(cal.getTime());
------------------------------------------------------------------

표준시간대를 지정하고 날짜를 가져오기.
------------------------------------------------------------------
TimeZone jst = TimeZone.getTimeZone ("JST");
Calendar cal = Calendar.getInstance ( jst ); // 주어진 시간대에 맞게 현재 시각으로 초기화된 GregorianCalender 객체를 반환.// 또는 Calendar now = Calendar.getInstance(Locale.KOREA);
System.out.println ( cal.get ( Calendar.YEAR ) + "년 " + ( cal.get ( Calendar.MONTH ) + 1 ) + "월 " + cal.get ( Calendar.DATE ) + "일 " + cal.get ( Calendar.HOUR_OF_DAY ) + "시 " +cal.get ( Calendar.MINUTE ) + "분 " + cal.get ( Calendar.SECOND ) + "초 " );

결과 : 2000년 8월 5일 16시 16분 47초
------------------------------------------------------------------

영어로된 날짜를 숫자로 바꾸기
------------------------------------------------------------------
Date myDate = new Date ( "Sun,5 Dec 1999 00:07:21" );
System.out.println ( myDate.getYear ( ) + "-" + myDate.getMonth ( ) + "-" + myDate.getDay ( ) );
------------------------------------------------------------------

"Sun, 5 Dec 1999 00:07:21"를 "1999-12-05"로 바꾸기
------------------------------------------------------------------
SimpleDateFormat formatter_one = new SimpleDateFormat ( "EEE, dd MMM yyyy hh:mm:ss",Locale.ENGLISH );
SimpleDateFormat formatter_two = new SimpleDateFormat ( "yyyy-MM-dd" );

String inString = "Sun, 5 Dec 1999 00:07:21";

ParsePosition pos = new ParsePosition ( 0 );
Date frmTime = formatter_one.parse ( inString, pos );
String outString = formatter_two.format ( frmTime );

System.out.println ( outString );
------------------------------------------------------------------

숫자 12자리를, 다시 날짜로 변환하기
------------------------------------------------------------------
Date conFromDate = new Date();
long ttl = conFromDate.parse ( "Dec 25, 1997 10:10:10" );
System.out.println ( ttl ); //예 938291839221

Date today = new Date ( ttl );
DateFormat format = DateFormat.getDateInstance ( DateFormat.FULL,Locale.US );
String formatted = format.format ( today );
System.out.println ( formatted );
------------------------------------------------------------------

특정일로부터 n일 만큼 이동한 날짜 구하기
------------------------------------------------------------------
특정일의 시간을 long형으로 읽어온다음..
날짜*24*60*60*1000 을 계산하여.
long형에 더해줍니다.
그리고 나서 Date클래스와 Calender클래스를 이용해서 날짜와 시간을 구하면 됩니다
------------------------------------------------------------------

특정일에서 일정 기간후의 날짜 구하기2
------------------------------------------------------------------
//iDay 에 입력하신 만큼 빼거나 더한 날짜를 반환 합니다.
import java.util.*;

public String getDate ( int iDay )
{
Calendar temp=Calendar.getInstance ( );
StringBuffer sbDate=new StringBuffer ( );

temp.add ( Calendar.DAY_OF_MONTH, iDay );

int nYear = temp.get ( Calendar.YEAR );
int nMonth = temp.get ( Calendar.MONTH ) + 1;
int nDay = temp.get ( Calendar.DAY_OF_MONTH );

sbDate.append ( nYear );
if ( nMonth < 10 )
sbDate.append ( "0" );
sbDate.append ( nMonth );
if ( nDay < 10 )
sbDate.append ( "0" );
sbDate.append ( nDay );

return sbDate.toString ( );
}
------------------------------------------------------------------

현재날짜에서 2달전의 날짜를 구하기
------------------------------------------------------------------
Calendar cal = Calendar.getInstance ( );//오늘 날짜를 기준으루..
cal.add ( cal.MONTH, -2 ); //2개월 전....
System.out.println ( cal.get ( cal.YEAR ) );
System.out.println ( cal.get ( cal.MONTH ) + 1 );
System.out.println ( cal.get ( cal.DATE ) );
------------------------------------------------------------------

달에 마지막 날짜 구하기
------------------------------------------------------------------
for ( int month = 1; month <= 12; month++ )
{
GregorianCalendar cld = new GregorianCalendar ( 2001, month - 1, 1 );
System.out.println ( month + "/" + cld.getActualMaximum ( Calendar.DAY_OF_MONTH ) );
}
------------------------------------------------------------------

해당하는 달의 마지막 일 구하기
------------------------------------------------------------------
GregorianCalendar today = new GregorianCalendar ( );
int maxday = today.getActualMaximum ( ( today.DAY_OF_MONTH ) );
System.out.println ( maxday );
------------------------------------------------------------------

특정일을 입력받아 해당 월의 마지막 날짜를 구하는 간단한 예제.(달은 -1 해준다.)...윤달 30일 31일 알아오기
------------------------------------------------------------------
Calendar cal = Calendar.getInstance ( );
cal.set ( Integer.parseInt ( args[0] ), Integer.parseInt ( args [1] ) - 1, Integer.parseInt ( args [2] ) );
SimpleDateFormat dFormat = new SimpleDateFormat ( "yyyy-MM-dd" );
System.out.println ( "입력 날짜 " + dFormat.format ( cal.getTime ( ) ) );
System.out.println ( "해당 월의 마지막 일자 : " + cal.getActualMaximum ( Calendar.DATE ) );
------------------------------------------------------------------

해당월의 실제 날짜수 구하기 ( 1999년 1월달의 실제 날짜수를 구하기 )
------------------------------------------------------------------
Calendar calendar = Calendar.getInstance ( );
calendar.set ( 1999, 0, 1 );
int maxDays = calendar.getActualMaximum ( Calendar.DAY_OF_MONTH );
------------------------------------------------------------------

어제 날짜 구하기
------------------------------------------------------------------
오늘날짜를 초단위로 구해서 하루분을 빼주고 다시
셋팅해주면 쉽게 구할수 있죠..
setTime((기준일부터 오늘까지의 초를 구함) - 24*60*60)해주면 되겠죠..
------------------------------------------------------------------

어제 날짜 구하기2
------------------------------------------------------------------
import java.util.*;

public static Date getYesterday ( Date today )
{
if ( today == null )
throw new IllegalStateException ( "today is null" );
Date yesterday = new Date ( );
yesterday.setTime ( today.getTime ( ) - ( (long) 1000 * 60 * 60 * 24 ) );

return yesterday;
}
------------------------------------------------------------------

내일 날짜 구하기
------------------------------------------------------------------
Date today = new Date ( );
Date tomorrow = new Date ( today.getTime ( ) + (long) ( 1000 * 60 * 60 * 24 ) );
------------------------------------------------------------------

내일 날짜 구하기2
------------------------------------------------------------------
Calendar today = Calendar.getInstance ( );
today.add ( Calendar.DATE, 1 );
Date tomorrow = today.getTime ( );
------------------------------------------------------------------

오늘날짜에서 5일 이후 날짜를 구하기
------------------------------------------------------------------
Calendar cCal = Calendar.getInstance();
c.add(Calendar.DATE, 5);
------------------------------------------------------------------

날짜에 해당하는 요일 구하기
------------------------------------------------------------------
//DAY_OF_WEEK리턴값이 일요일(1), 월요일(2), 화요일(3) ~~ 토요일(7)을 반환합니다.
//아래 소스는 JSP일부입니다.
import java.util.*;

Calendar cal= Calendar.getInstance ( );
int day_of_week = cal.get ( Calendar.DAY_OF_WEEK );
if ( day_of_week == 1 )
m_week="일요일";
else if ( day_of_week == 2 )
m_week="월요일";
else if ( day_of_week == 3 )
m_week="화요일";
else if ( day_of_week == 4 )
m_week="수요일";
else if ( day_of_week == 5 )
m_week="목요일";
else if ( day_of_week == 6 )
m_week="금요일";
else if ( day_of_week == 7 )
m_week="토요일";

오늘은 : 입니다.
------------------------------------------------------------------

콤보박스로 선택된 날짜(예:20001023)를 통해 요일을 영문으로 가져오기
------------------------------------------------------------------
//gc.get(gc.DAY_OF_WEEK); 하면 일요일=1, 월요일=2, ..., 토요일=7이 나오니까,
//요일을 배열로 만들어서 뽑아내면 되겠죠.
GregorianCalendar gc=new GregorianCalendar ( 2000, 10 - 1 , 23 );
String [] dayOfWeek = { "", "Sun", "Mon", .... , "Sat" };
String yo_il = dayOfWeek ( gc.get ( gc.DAY_OF_WEEK ) );
------------------------------------------------------------------

두 날짜의 차이를 일수로 구하기
------------------------------------------------------------------
각각의 날짜를 Date형으로 만들어서 getTime()하면
long으로 값이 나오거든요(1970년 1월 1일 이후-맞던가?- 1/1000 초 단위로..)
그러면 이값의 차를 구해서요. (1000*60*60*24)로 나누어 보면 되겠죠.
------------------------------------------------------------------

두 날짜의 차이를 일수로 구하기2
------------------------------------------------------------------
import java.io.*;
import java.util.*;

Date today = new Date ( );
Calendar cal = Calendar.getInstance ( );
cal.setTime ( today );// 오늘로 설정.

Calendar cal2 = Calendar.getInstance ( );
cal2.set ( 2000, 3, 12 ); // 기준일로 설정. month의 경우 해당월수-1을 해줍니다.

int count = 0;
while ( !cal2.after ( cal ) )
{
count++;
cal2.add ( Calendar.DATE, 1 ); // 다음날로 바뀜

System.out.println ( cal2.get ( Calendar.YEAR ) + "년 " + ( cal2.get ( Calendar.MONTH ) + 1 ) + "월 " + cal2.get ( Calendar.DATE ) + "일" );
}

System.out.println ( "기준일로부터 " + count + "일이 지났습니다." );
------------------------------------------------------------------

두 날짜의 차이를 일수로 구하기3
------------------------------------------------------------------
import java.io.*;
import java.util.*;

public class DateDiff
{
public static int GetDifferenceOfDate ( int nYear1, int nMonth1, int nDate1, int nYear2, int nMonth2, int nDate2 )
{
Calendar cal = Calendar.getInstance ( );
int nTotalDate1 = 0, nTotalDate2 = 0, nDiffOfYear = 0, nDiffOfDay = 0;

if ( nYear1 > nYear2 )
{
for ( int i = nYear2; i < nYear1; i++ )
{
cal.set ( i, 12, 0 );
nDiffOfYear += cal.get ( Calendar.DAY_OF_YEAR );
}
nTotalDate1 += nDiffOfYear;
}
else if ( nYear1 < nYear2 )
{
for ( int i = nYear1; i < nYear2; i++ )
{
cal.set ( i, 12, 0 );
nDiffOfYear += cal.get ( Calendar.DAY_OF_YEAR );
}
nTotalDate2 += nDiffOfYear;
}

cal.set ( nYear1, nMonth1-1, nDate1 );
nDiffOfDay = cal.get ( Calendar.DAY_OF_YEAR );
nTotalDate1 += nDiffOfDay;

cal.set ( nYear2, nMonth2-1, nDate2 );
nDiffOfDay = cal.get ( Calendar.DAY_OF_YEAR );
nTotalDate2 += nDiffOfDay;

return nTotalDate1-nTotalDate2;
}

public static void main ( String args[] )
{
System.out.println ( "" + GetDifferenceOfDate (2000, 6, 15, 1999, 8, 23 ) );
}
}
------------------------------------------------------------------

파일에서 날짜정보를 가져오기
------------------------------------------------------------------
File f = new File ( directory, file );

Date date = new Date ( f.lastModified ( ) );
Calendar cal = Calendar.getInstance ( );
cal.setTime ( date );

System.out.println("Year : " + cal.get(Calendar.YEAR));
System.out.println("Month : " + (cal.get(Calendar.MONTH) + 1));
System.out.println("Day : " + cal.get(Calendar.DAY_OF_MONTH));
System.out.println("Hours : " + cal.get(Calendar.HOUR_OF_DAY));
System.out.println("Minutes : " + cal.get(Calendar.MINUTE));
System.out.println("Second : " + cal.get(Calendar.SECOND));
------------------------------------------------------------------

날짜형식으로 2000-01-03으로 처음에 인식을 시킨후
7일씩 증가해서 1년정도의 날짜를 출력해 주고 싶은데요.
------------------------------------------------------------------
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-mm-dd" );
Calendar c = Calendar.getInstance ( );

for ( int i = 0; i < 48; i++ )
{
c.clear ( );
c.set ( 2000, 1, 3 - ( i * 7 ) );
java.util.Date d = c.getTime ( );
String thedate = sdf.format ( d );
System.out.println ( thedate );
}
------------------------------------------------------------------

쓰레드에서 날짜 바꾸면 죽는 문제
------------------------------------------------------------------
Main화면에 날짜와시간이Display되는 JPanel이 있습니다.
date로 날짜와 시간을 변경하면 Main화면의 날짜와 시간이 Display되는 Panel에
변경된 날짜가 Display되지 않고 Main화면이 종료되어 버립니다.

문제소스:
public void run ( )
{
while ( true )
{
try{
timer.sleep ( 60000 );
}
catch ( InterruptedException ex ) { }

lblTimeDate.setText ( fGetDateTime ( ) );
repaint ( );
}
}

public String fGetDateTime ( )
{
final int millisPerHour = 60 * 60 * 1000;
String DATE_FORMAT = "yyyy / MM / dd HH:mm";
SimpleDateFormat sdf = new SimpleDateFormat ( DATE_FORMAT );
SimpleTimeZone timeZone = new SimpleTimeZone ( 9 * millisPerHour, "KST" );
sdf.setTimeZone ( timeZone );

long time = System.currentTimeMillis ( );
Date date = new Date ( time );
return sdf.format ( date );
}

해답:
// 날짜와 요일 구한다. timezone 으로 날짜를 다시 셋팅하시면 됨니다.
public String getDate ( )
{
Date now = new Date ( );
SimpleDateFormat sdf4 = new SimpleDateFormat ( "yyyy/MM/dd HH:mm EE" );
sdf4.setTimeZone ( TimeZone.getTimeZone ( "Asia/Seoul" ) );

return sdf4.format ( now );
}
------------------------------------------------------------------

날짜와 시간이 유효한지 검사하려면...?
------------------------------------------------------------------
import java.util.*;
import java.text.*;

public class DateCheck
{
boolean dateValidity = true;

DateCheck ( String dt )
{
try
{
DateFormat df = DateFormat.getDateInstance ( DateFormat.SHORT );
df.setLenient ( false );
Date dt2 = df.parse ( dt );
}
catch ( ParseException e ) { this.dateValidity = false; }
catch ( IllegalArgumentException e ) { this.dateValidity = false; }
}

public boolean datevalid ( )
{
return dateValidity;
}

public static void main ( String args [] )
{
DateCheck dc = new DateCheck ( "2001-02-28" );
System.out.println ( " 유효한 날짜 : " + dc.datevalid ( ) );
}
}
------------------------------------------------------------------

두 날짜 비교하기(아래보다 정확)
------------------------------------------------------------------
그냥 날짜 두개를 long(밀리 세컨드)형으로 비교하시면 됩니다...

이전의 데이타가 date형으로 되어 있다면, 이걸 long형으로 변환하고.
현재 날짜(시간)은 System.currentTimeMillis()메소드로 읽어들이고,
두수(long형)를 연산하여 그 결과 값으로 비교를 하시면 됩니다.

만약 그 결과값이 몇시간 혹은 며칠차이가 있는지를 계산할려면,
결과값을 Calender의 setTimeInMillis(long millis) 메소드를 이용해
설정한다음 각각의 날짜나 시간을 읽어오시면 됩니다
------------------------------------------------------------------

두 날짜 비교하기2
------------------------------------------------------------------
//Calendar를 쓸 경우 데이타의 원본을 고치기 때문에 clone()을 사용하여
//복사한 후에 그 복사본을 가지고 비교한다
import java.util.*;
import java.util.Calendar.*;
import java.text.SimpleDateFormat;

public class DayComparisonTest
{
public static void main(String args[])
{
Calendar cal = Calendar.getInstance();
SimpleDateFormat dateForm = new SimpleDateFormat("yyyy-MM-dd");

Calendar aDate = Calendar.getInstance(); // 비교하고자 하는 임의의 날짜
aDate.set(2001, 0, 1);

Calendar bDate = Calendar.getInstance(); // 이것이 시스템의 날짜

// 여기에 시,분,초를 0으로 세팅해야 before, after를 제대로 비교함
aDate.set( Calendar.HOUR_OF_DAY, 0 );
aDate.set( Calendar.MINUTE, 0 );
aDate.set( Calendar.SECOND, 0 );
aDate.set( Calendar.MILLISECOND, 0 );

bDate.set( Calendar.HOUR_OF_DAY, 0 );
bDate.set( Calendar.MINUTE, 0 );
bDate.set( Calendar.SECOND, 0 );
bDate.set( Calendar.MILLISECOND, 0 );


if (aDate.after(bDate)) // aDate가 bDate보다 클 경우 출력
System.out.println("시스템 날짜보다 뒤일 경우 aDate = " + dateForm.format(aDate.getTime()));
else if (aDate.before(bDate)) // aDate가 bDate보다 작을 경우 출력
System.out.println("시스템 날짜보다 앞일 경우 aDate = " + dateForm.format(aDate.getTime()));
else // aDate = bDate인 경우
System.out.println("같은 날이구만");
}
}

 

출처 : http://dduri.net/blog/772

오라클 - 에러 메세지 [ORA-02201 to ORA-02300]

ORA-02201 sequence not allowed here

Cause: An attempt was made to reference a sequence in a from-list.

Action: A sequence can only be referenced in a select-list.


ORA-02202 no more tables permitted in this cluster

Cause: An attempt was made to create a table in a cluster which already contains 32 tables.

Action: Up to 32 tables may be stored per cluster.


ORA-02203 INITIAL storage options not allowed

Cause: An attempt was made to alter the INITIAL storage option of a table, cluster, index, or rollback segment. These options may only be specified when the object is created.

Action: Remove these options and retry the statement.


ORA-02204 ALTER, INDEX and EXECUTE not allowed for views

Cause: An attempt was made to grant or revoke an invalid privilege on a view.

Action: Do not attempt to grant or revoke any of ALTER, INDEX, or EXECUTE privileges on views.


ORA-02205 only SELECT and ALTER privileges are valid for sequences

Cause: An attempt was made to grant or revoke an invalid privilege on a sequence.

Action: Do not attempt to grant or revoke DELETE, INDEX, INSERT, UPDATE, REFERENCES or EXECUTE privilege on sequences.


ORA-02206 duplicate INITRANS option specification

Cause: INITRANS is specified more than once.

Action: Specify INITRANS at most once.


ORA-02207 invalid INITRANS option value

Cause: The INITRANS value is not an integer between 1 and 255 and less than or equal to the MAXTRANS value.

Action: Choose a valid INITRANS value.


ORA-02208 duplicate MAXTRANS option specification

Cause: MAXTRANS is specified more than once.

Action: Specify MAXTRANS at most once.


ORA-02209 invalid MAXTRANS option value

Cause: The MAXTRANS value is not an integer between 1 and 255 and greater than or equal to the INITRANS value.

Action: Choose a valid MAXTRANS value.


ORA-02210 no options specified for ALTER TABLE

Cause: No ALTER TABLE option was specified.

Action: Specify at least one alter table option.


ORA-02211 invalid value for PCTFREE or PCTUSED

Cause: The specified value for PCTFREE or PCTUSED is not an integer between 0 and 100.

Action: Choose an appropriate value for the option.


ORA-02212 duplicate PCTFREE option specification

Cause: PCTFREE option specified more than once.

Action: Specify PCTFREE at most once.


ORA-02213 duplicate PCTUSED option specification

Cause: PCTUSED option specified more than once.

Action: Specify PCTUSED at most once.


ORA-02214 duplicate BACKUP option specification

Cause: The BACKUP option to ALTER TABLE is specified more than once.

Action: Specify the option at most once.


ORA-02215 duplicate tablespace name clause

Cause: There is more than one TABLESPACE clause in the CREATE TABLE, CREATE INDEX, or CREATE ROLLBACK SEGMENT statement.

Action: Specify at most one TABLESPACE clause.


ORA-02216 tablespace name expected

Cause: A tablespace name is not present where required by the syntax for one of the following statements: CREATE/DROP TABLESPACE, CREATE TABLE, CREATE INDEX, or CREATE ROLLBACK SEGMENT.

Action: Specify a tablespace name where required by the syntax.


ORA-02217 duplicate storage option specification

Cause: A storage option (INIITAL, NEXT, MINEXTENTS, MAXEXTENTS, PCTINCREASE) is specified more than once.

Action: Specify all storage options at most once.


ORA-02218 invalid INITIAL storage option value

Cause: The specified value must be an integer.

Action: Choose an appropriate integer value.


ORA-02219 invalid NEXT storage option value

Cause: The specified value must be an integer.

Action: Choose an appropriate integer value.


ORA-02220 invalid MINEXTENTS storage option value

Cause: The specified value must be a positive integer less than or equal to MAXEXTENTS.

Action: Specify an appropriate value.


ORA-02221 invalid MAXEXTENTS storage option value

Cause: The specified value must be a positive integer greater than or equal to MINEXTENTS.

Action: Specify an appropriate value.


ORA-02222 invalid PCTINCREASE storage option value

Cause: The specified value must be a positive integer.

Action: Specify an appropriate value.


ORA-02223 invalid OPTIMAL storage option value

Cause: The specified value must be an integer.

Action: Choose an appropriate integer value.


ORA-02224 EXECUTE privilege not allowed for tables

Cause: An attempt was made to grant or revoke an invalid privilege on a table.

Action: Do not attempt to grant or revoke EXECUTE privilege on tables.


ORA-02225 only EXECUTE and DEBUG privileges are valid for procedures

Cause: An attempt was made to grant or revoke an invalid privilege on a procedure, function or package.

Action: Do not attempt to grant or revoke any privilege besides EXECUTE or DEBUG on procedures, functions or packages.


ORA-02226 invalid MAXEXTENTS value (max allowed: string)

Cause: The MAXEXTENTS specified is too large for the database block size. This applies only to SYSTEM rollback segment.

Action: Specify a smaller value.


ORA-02227 invalid cluster name

Cause: A cluster name was not properly formed.

Action: Check the rules for forming object names and enter an appropriate cluster name.


ORA-02228 duplicate SIZE specification

Cause: The SIZE option is specified more than once.

Action: Specify the SIZE option at most once.


ORA-02229 invalid SIZE option value

Cause: The specified value must be an integer number of bytes.

Action: Specify an appropriate value.


ORA-02230 invalid ALTER CLUSTER option

Cause: An option other than PCTFREE, PCTUSED, INITRANS, MAXTRANS, STORAGE, or SIZE is specified in an ALTER CLUSTER statement.

Action: Specify only legal options.


ORA-02231 missing or invalid option to ALTER DATABASE

Cause: An option other than ADD, DROP, RENAME, ARCHIVELOG, NOARCHIVELOG, MOUNT, DISMOUNT, OPEN, or CLOSE is specified in the statement.

Action: Specify only legal options.


ORA-02232 invalid MOUNT mode

Cause: A mode other than SHARED or EXCLUSIVE follows the MOUNT keyword in an ALTER DATABASE statement.

Action: Specify either SHARED, EXCLUSIVE, or nothing following MOUNT.


ORA-02233 invalid CLOSE mode

Cause: A mode other than NORMAL or IMMEDIATE follows the CLOSE keyword in an ALTER DATABASE statement.

Action: Specify either NORMAL, IMMEDIATE, or nothing following CLOSE.


ORA-02234 changes to this table are already logged

Cause: The log table to be added is a duplicate of another.

Action: Do not add this change log to the system; check that the replication product's system tables are consistent.


ORA-02235 this table logs changes to another table already

Cause: The table to be altered is already a change log for another table.

Action: Do not log changes to the specified base table to this table; check that the replication product's system tables are consistent.


ORA-02236 invalid file name

Cause: A character string literal was not used in the file name list of a LOGFILE, DATAFILE, or RENAME clause.

Action: Use correct syntax.


ORA-02237 invalid file size

Cause: A non-integer value was specified in the SIZE or RESIZE clause.

Action: Use correct syntax.


ORA-02238 filename lists have different numbers of files

Cause: In a RENAME clause in ALTER DATABASE or TABLESPACE, the number of existing file names does not equal the number of new file names.

Action: Make sure there is a new file name to correspond to each existing file name.


ORA-02239 there are objects which reference this sequence

Cause: The sequence to be dropped is still referenced by other objects.

Action: Make sure the sequence name is correct or drop the constraint or object that references the sequence.


ORA-02240 invalid value for OBJNO or TABNO

Cause: A number does not follow either OBJNO or TABNO.

Action: Specify a number after OBJNO or TABNO.


ORA-02241 must of form EXTENTS (FILE n BLOCK n SIZE n, ...)

Cause: There was an error in the extent storage clause.

Action: Respecify the storage clause using the correct syntax and retry the command.


ORA-02242 no options specified for ALTER INDEX

Cause: No options specified.

Action: Specify at least one of REBUILD, INITRANS, MAXTRANS, or STORAGE.


ORA-02243 invalid ALTER INDEX or ALTER MATERIALIZED VIEW option

Cause: An option other than INITRANS, MAXTRANS, or STORAGE is specified in an ALTER INDEX statement or in the USING INDEX clause of an ALTER MATERIALIZED VIEW statement.

Action: Specify only legal options.


ORA-02244 invalid ALTER ROLLBACK SEGMENT option

Cause: The STORAGE option is expected but not found.

Action: Specify the STORAGE option.


ORA-02245 invalid ROLLBACK SEGMENT name

Cause: An identifier was expected, but not found, following ALTER [PUBLIC] ROLLBACK SEGMENT.

Action: Place a rollback segment name following SEGMENT.


ORA-02246 missing EVENTS text

Cause: A character string literal was expected, but not found, following ALTER SESSION SET EVENTS.

Action: Place the string literal containing the events text after EVENTS.


ORA-02247 no option specified for ALTER SESSION

Cause: The option SET EVENTS was expected, but not found, following ALTER SESSION.

Action: Place the SET EVENTS option after ALTER SESSION.


ORA-02248 invalid option for ALTER SESSION

Cause: An option other than SET EVENTS was found following the ALTER SESSION command.

Action: Specify the SET EVENTS option after the ALTER SESSION command and try again.


ORA-02249 missing or invalid value for MAXLOGMEMBERS

Cause: A valid number does not follow MAXLOGMEMBERS. The value specified must be between 1 and the port-specific maximum number of log file members.

Action: Specify a valid number after MAXLOGMEMBERS.


ORA-02250 missing or invalid constraint name

Cause: The constraint name is missing or invalid.

Action: Specify a valid identifier name for the constraint name.


ORA-02251 subquery not allowed here

Cause: Subquery is not allowed here in the statement.

Action: Remove the subquery from the statement.


ORA-02252 check constraint condition not properly ended

Cause: The specified search condition for the check constraint is not properly ended.

Action: End the condition properly.


ORA-02253 constraint specification not allowed here

Cause: Constraint specification is not allowed here in the statement.

Action: Remove the constraint specification from the statement.


ORA-02254 DEFAULT expression not allowed here

Cause: Default value expression is not allowed for the column here in the statement.

Action: Remove the default value expression from the statement.


ORA-02255: NOT NULL not allowed after DEFAULT NULL

Cause: A NOT NULL specification conflicts with the NULL default value.

Action: Remove either the NOT NULL or the DEFAULT NULL specification and try again.


ORA-02256 number of referencing columns must match referenced columns

Cause: The number of columns in the foreign-key referencing list is not equal to the number of columns in the referenced list.

Action: Make sure that the referencing columns match the referenced columns.


ORA-02257 maximum number of columns exceeded

Cause: The number of columns in the key list exceeds the maximum number.

Action: Reduce the number columns in the list.


ORA-02258 duplicate or conflicting NULL and/or NOT NULL specifications

Cause: A duplicate or conflicting NULL and/or NOT NULL was specified.

Action: Remove one of the conflicting specifications and try again.


ORA-02259 duplicate UNIQUE/PRIMARY KEY specifications

Cause: A duplicate unique or primary key was specified.

Action: Remove the duplicate specification and try again.


ORA-02260 table can have only one primary key

Cause: Two or more primary keys were specified for the same table.

Action: Remove the extra primary keys and try again.


ORA-02261 such unique or primary key already exists in the table

Cause: A unique or primary key was specified that already exists for the table.

Action: Remove the extra key and try again.


ORA-02262 ORA-string occurs while type-checking column default value expressionexpression

Cause: New column datatype causes type-checking error for existing column default value expression.

Action: Remove the default value expression or do not alter the column datatype.


ORA-02263 need to specify the datatype for this column

Cause: The required datatype for the column is missing.

Action: Specify the required datatype.


ORA-02264 name already used by an existing constraint

Cause: The specified constraint name has to be unique.

Action: Specify a unique constraint name for the constraint.


ORA-02265 cannot derive the datatype of the referencing column

Cause: The datatype of the referenced column is not defined as yet.

Action: Make sure that the datatype of the referenced column is defined before referencing it.


ORA-02266 unique/primary keys in table referenced by enabled foreign keys

Cause: An attempt was made to drop or truncate a table with unique or primary keys referenced by foreign keys enabled in another table.

Action: Before dropping or truncating the table, disable the foreign key constraints in other tables. You can see what constraints are referencing a table by issuing the following command:

select constraint_name, table_name, status from user_constraints where r_constraint_name in ( select constraint_name from user_constraints where table_name ='tabnam');  

ORA-02267 column type incompatible with referenced column type

Cause: The datatype of the referencing column is incompatible with the datatype of the referenced column.

Action: Select a compatible datatype for the referencing column.


ORA-02268 referenced table does not have a primary key

Cause: The referenced table does not have a primary key.

Action: Specify explicitly the referenced table unique key.


ORA-02269 key column cannot be of LONG datatype

Cause: An attempt was made to define a key column of datatype LONG. This is not allowed.

Action: Change the datatype of the column or remove the LONG column from the key, and try again.


ORA-02270 no matching unique or primary key for this column-list

Cause: An attempt was made to reference a unique or primary key in a table with a CREATE or ALTER TABLE statement when no such key exists in the referenced table.

Action: Add the unique or primary key to the table or find the correct names of the columns with the primary or unique key, and try again.


ORA-02271 table does not have such constraint

Cause: An attempt was made to reference a table using a constraint that does not exist.

Action: Check the spelling of the constraint name or add the constraint to the table, and try again.


ORA-02272 constrained column cannot be of LONG datatype

Cause: A constrained column cannot be defined as datatype LONG. This is not allowed.

Action: Change the datatype of the column or remove the constraint on the column, and try again.


ORA-02273 this unique/primary key is referenced by some foreign keys

Cause: A unique or primary key referenced by foreign keys cannot be dropped.

Action: Remove all references to the key before dropping it.


ORA-02274 duplicate referential constraint specifications

Cause: A referential constraint was specified more than once. This is not allowed.

Action: Remove the duplicate specification.


ORA-02275 such a referential constraint already exists in the table

Cause: An attempt was made to specify a referential constraint that already exists. This would result in duplicate specifications and so is not allowed.

Action: Be sure to specify a constraint only once.


ORA-02276 default value type incompatible with column type

Cause: The type of the evaluated default expression is incompatible with the datatype of the column.

Action: Change the type of the column, or modify the default expression.


ORA-02277 invalid sequence name

Cause: The specified sequence name is not a valid identifier name.

Action: Specify a valid identifier name for the sequence name.


ORA-02278 duplicate or conflicting MAXVALUE/NOMAXVALUE specifications

Cause: Duplicate or conflicting MAXVALUE and/or NOMAXVALUE specifications.

Action: Remove one of the conflicting specifications and try again.


ORA-02279 duplicate or conflicting MINVALUE/NOMINVALUE specifications

Cause: Duplicate or conflicting MINVALUE and/or NOMINVALUE clauses were specified.

Action: Remove one of the conflicting specifications and try again.


ORA-02280 duplicate or conflicting CYCLE/NOCYCLE specifications

Cause: Duplicate or conflicting CYCLE and/or NOCYCLE clauses were specified.

Action: Remove one of the conflicting specifications and try again.


ORA-02281 duplicate or conflicting CACHE/NOCACHE specifications

Cause: Duplicate or conflicting CACHE and/or NOCACHE clauses were specified.

Action: Remove one of the conflicting specifications and try again.


ORA-02282 duplicate or conflicting ORDER/NOORDER specifications

Cause: Duplicate or conflicting ORDER and/or NOORDER clauses were specified.

Action: Remove one of the conflicting specifications and try again.


ORA-02283 cannot alter starting sequence number

Cause: An attempt was made to alter a starting sequence number. This is not allowed.

Action: Do not try to alter a starting sequence number.


ORA-02284 duplicate INCREMENT BY specifications

Cause: A duplicate INCREMENT BY clause was specified.

Action: Remove the duplicate specification and try again.


ORA-02285 duplicate START WITH specifications

Cause: A duplicate START WITH clause was specified.

Action: Remove the duplicate specification and try again.


ORA-02286 no options specified for ALTER SEQUENCE

Cause: No ALTER SEQUENCE option was specified.

Action: Check the syntax. Then specify at least one ALTER SEQUENCE option.


ORA-02287 sequence number not allowed here

Cause: The specified sequence number reference, CURRVAL or NEXTVAL, is inappropriate at this point in the statement.

Action: Check the syntax. Then remove or relocate the sequence number.


ORA-02288 invalid OPEN mode

Cause: A mode other than RESETLOGS was specified in an ALTER DATABASE OPEN statement. RESETLOGS is the only valid OPEN mode.

Action: Remove the invalid mode from the statement or replace it with the keyword RESETLOGS, and try again.


ORA-02289 sequence does not exist

Cause: The specified sequence does not exist, or the user does not have the required privilege to perform this operation.

Action: Make sure the sequence name is correct, and that you have the right to perform the desired operation on this sequence.


ORA-02290 check constraint (string.string) violated

Cause: The value or values attempted to be entered in a field or fields violate a defined check constraint.

Action: Enter values that satisfy the constraint.


ORA-02291 integrity constraint (string.string) violated - parent key not found

Cause: A foreign key value has no matching primary key value.

Action: Delete the foreign key or add a matching primary key.


ORA-02292 integrity constraint (string.string) violated - child record found

Cause: An attempt was made to delete a row that is referenced by a foreign key.

Action: It is necessary to DELETE or UPDATE the foreign key before changing this row.


ORA-02293 cannot validate (string.string) - check constraint violated

Cause: An attempt was made via an ALTERTABLE statement to add a check constraint to a populated table that had no complying values.

Action: Retry the ALTER TABLE statement, specifying a check constraint on a table containing complying values. For more information about ALTER TABLE, see the Oracle9i SQL Reference.


ORA-02294 cannot enable (string.string) - constraint changed during validation

Cause: While one DDL statement was attempting to enable this constraint, another DDL changed this same constraint.

Action: Try again, with only one DDL changing the constraint this time.


ORA-02295 found more than one enable/disable clause for constraint

Cause: An attempt was made via a CREATE or ALTER TABLE statement to specify more than one ENABLE and/or DISABLE clause for a given constraint.

Action: Only one ENABLE or DISABLE clause may be specified for a given constraint.


ORA-02296 cannot enable (string.string) - null values found

Cause: An ALTER TABLE command with an ENABLE CONSTRAINT clause failed because the table contains values that do not satisfy the constraint.

Action: Make sure that all values in the table satisfy the constraint before issuing an ALTER TABLE command with an ENABLE CONSTRAINT clause. For more information about ALTER TABLE and ENABLE CONSTRAINT, see the Oracle9i SQL Reference.


ORA-02297 cannot disable constraint (string.string) - dependencies exist

Cause: An alter table disable constraint failed because the table has foreign keys that are dependent on the constraint.

Action: Either disable the foreign key constraints or use a DISABLE CASCADE command.


ORA-02298 cannot validate (string.string) - parent keys not found

Cause: An ALTER TABLE ENABLE CONSTRAINT command failed because the table has orphaned child records.

Action: Make sure that the table has no orphaned child records before issuing an ALTER TABLE ENABLE CONSTRAINT command. For more information about ALTER TABLE and ENABLE CONSTRAINT, see the Oracle9i SQL Reference.


ORA-02299 cannot validate (string.string) - duplicate keys found

Cause: An ALTER TABLE ENABLE CONSTRAINT command failed because the table has duplicate key values.

Action: Make sure that the table has no duplicate key values before issuing an ALTER TABLE ENABLE CONSTRAINT command. For more information about ALTER TABLE and ENABLE CONSTRAINT, see the Oracle9i SQL Reference.


ORA-02300 invalid value for OIDGENERATORS

Cause: A number was not specified for the value of OIDGENERATORS.