CUBRID�Manager�개발�튜터리얼

CUBRID�Manager�개발�튜터리얼

CUBRIDManager개발튜터리얼 작성자:오픈소스개발자최중연(pcraft) 진행순서 1.CUBRID소개및설치 2.CUBRIDMANAGER소개 3.개발환경구성 4.아키텍처 5.튜터리얼 6.CUBRID도구개발의방향 1.CUBRID소개및설치 1.1인터넷서비스를위한무료DBMS 라이선스모델 GNUGPLv2 DBMSENGINE + = FREE BSD INTERFACE 1.2주요특징 인터넷서비스에최적화된기능 Pagination ClickCounter Partition QueryPlanCache Replication QueryResultCache HighAvailability JavaSP 1.2주요특징 Pagination Pagination ROWNUM FORORDERBY_NUM() FORGROUPBY_NUM() 1.2주요특징 Partition HASH Partition RANGE LIST 1.2주요특징 Replication Replication •서버분산을통한성능향상및장애발생시긴급대처 •트랜잭션로그기반의복제,중단없는온라인복제 •1:N의복제구성지원복제,상태관리기능지원복제 1.2주요특징 HighAvailability 24X365 장애발생및장애복구시자동절체를통해 중단없는고가용성서비스제공가능 1.2주요특징 ClickCounter SELECTINCR(col1)... ClickCounter 1.2주요특징 QueryPlanCache/QueryResultCache QueryPlanCache-쿼리컴파일시간단축 동일한패턴의쿼리수행시질의최적화기의 쿼리컴파일시간을최소화할수있도록지원 QueryPlanCache-쿼리데이터패치시간단축 같은쿼리에대해질의수행과정없이 캐쉬에있는결과를이용 1.2주요특징 JavaStoredProcedure •SQL로구현하지못하는복잡한프로그램로직구현 •JDBC를이용한이기종데이터베이스쿼리가능 •기존Java코드및개발환경재사용 JavaStoredProcedure 1.3지속적이고안정적인업데이트 CUBRIDEngineRoadmap (출처:CUBRID개발로드맵문서) 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 1.4CUBRIDDBMS설치 2.CUBRIDMANAGER소개 2.1CUBRIDManager의역할 DatabaseManagement UserManagement SpaceManagement SchemaManagement BackupandRecovery MonitoringandPerformanceTuningsupport Queryeditoranddatamanagementsupport 2.2그림으로보는주요기능 메인화면 2.2그림으로보는주요기능 스키마정보조회 2.2그림으로보는주요기능 데이터조회 2.2그림으로보는주요기능 실행계획및스키마정보조회 2.2그림으로보는주요기능 모니터링화면 2.3앞으로개발해야할기능들 Replication HA지원 파티션지원 SP지원 보안강화 SQL포매팅 마음만있다면 상태모니터링 함께할일은많이있습니다! 버그및코드개선 3.개발환경구성 3.1개발환경소개및개발언어소개 개발환경 Eclipse3.3 = + J2SE1.5 + CUBRID8.2.x + + Yourpassion 3.1개발환경소개및개발언어소개 개발언어 Java RCP,SWT,JFace 3.2Eclipse기본환경구성 Eclipse다운로드 http://www.eclipse.org/downloads/packages/release/europa/winter 3.2Eclipse기본환경구성 Eclipse실행 3.2Eclipse기본환경구성 SubclipsePlugin설치 Help-SoftwareUpdates-FindandInstall... 3.2Eclipse기본환경구성 SubclipsePlugin설치 3.2Eclipse기본환경구성 SubclipsePlugin설치 3.2Eclipse기본환경구성 PropeditPlugin설치 3.2Eclipse기본환경구성 PropeditPlugin설치 3.3CUBRIDManager개발사이트소개 CUBRIDManagerDevHome 3.3CUBRIDManager개발사이트소개 CUBRIDManagerHome 3.3CUBRIDManager개발사이트소개 포럼 3.3CUBRIDManager개발사이트소개 CUBRIDManagerHome 3.3CUBRIDManager개발사이트소개 소스저장소 3.3CUBRIDManager개발사이트소개 CUBRID도구개발카페 3.3CUBRIDManager개발사이트소개 큐브리드공부하기카페 3.4소스내려받기 소스체크아웃 3.4소스내려받기 소스체크아웃 3.4소스내려받기 소스체크아웃 3.4소스내려받기 소스체크아웃 https://dev.naver.com/svn/cubrid-manager/branches/RB-8.2.1 3.4소스내려받기 소스체크아웃 3.4소스내려받기 소스체크아웃 3.4소스내려받기 소스체크아웃 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) https://dev.naver.com/svn/cubrid-manager/materials/dependentPlugin 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) 3.4소스내려받기 EclipsePlugin설치(log4j) org.apache.log4j 3.4소스내려받기 EclipsePlugin설치(log4j) eclipse/plugins에org.apache.log4j_1.2.13.v200706111418.jar복사후이클립스재시동 3.5빌드및실행 3.5빌드및실행 3.5빌드및실행 3.5빌드및실행 3.5빌드및실행 64bitMacOSX에서32bitJRE를사용할경우 3.5빌드및실행 4.아키텍처 4.1서버프로세스와Manager아키텍처 CUBRIDManagerClient RCPApplicationInterface EclipsePlug-InInterface Multi-Language Package HelpPlug-in LoggerPackage CommonGUIInterface ChartPackage BussinessLogicInterface TCP/IP JDBC CUBRIDManagerServer Broker Server cub_broker cub_cas cub_auto cub_js cub_broker cub_cas cub_server 4.2컴포넌트소개 com.cubrid.cubridmanager.app com.cubrid.cubridmanager.plugin RCPApplicationInterface EclipsePlug-InInterface Launcher com.cubrid.cubridmanager.ui CommonGUIInterface UI com.cubrid.cubridmanager.help HelpPlug-in OnlineHelpsystem com.cubrid.cubridmanager.core BussinessLogicInterface CoreAPI 4.3컴포넌트별역할 SVN주소https://dev.naver.com/svn/cubrid-manager/branches/RB-8.2.1 Standaloneapplicationpackage -Launcher CoreAPIpackage -Task,Model,Businesslogicclasses EclipsePlug-inpackage -Launcher CommonUIpackage -Standalone,Plug-in의공통UI(SWT/JFace) 4.4컴포넌트별패키지구조 com.cubrid.cubridmanager.app,pluginpackage com.cubrid.cubridmanager.app com.cubrid.cubridmanager.plugin 독립실행빌드버전 EclipsePlug-in빌드버전 4.4컴포넌트별패키지구조 com.cubrid.cubridmanager.uipackage 4.4컴포넌트별패키지구조 com.cubrid.cubridmanager.corepackage 5.튜터리얼 5.1과제제시 요구사항접수 도구개발카페에올라온의견 INSERTINTOtable(col1,col2)VALUES(?,?) + CSV파일 5.2스팩정의 •측면네비게이션의테이블폴더에서컨텍스트메뉴를통해대화창접근 •SQL을입력하고CSV파일을선택 •컬럼목록은입력한SQL의컬럼목록기준(컬럼목록이없는SQL은에러처리) •미리보기테이블을제공하여SQL과CSV데이터의매핑을확인(최대10개만출력) •데이터입력후입력건수를유저에게알림 5.2스팩정의 기능접근포인트결정 측면네비게이션의테이블폴더에서 컨텍스트메뉴를통해대화창접근 5.2스팩정의 SQL입력및CSV파일입력 SQL입력창 CSV찾아보기 5.2스팩정의 미리보기제공 •미리보기테이블을제공하여SQL과CSV 데이터의매핑을확인 •성능문제로미리보기는최대10개만출력 •컬럼목록은입력한SQL의컬럼목록기준 (컬럼목록이없는SQL은에러처리) 5.2스팩정의 데이터입력결과창 데이터입력후입력건수를유저에게알림 5.3UI설계및구현 질의데이터입력대화창 CMTitleAreaDialog Multi-lineTextField Button-FileDialog TableViewer TextField-Editable Button-PreviewAction DynamicHelpsystem 5.3UI설계및구현 질의데이터입력대화창 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog com.cubrid.cubridmanager.ui.spi.dialog.CMTitleAreaDialog -상단제목영역을갖는공통DialogUI추상클래스 -동적도움말시스템을제공 com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 DialogUI구현 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog //"질의데이터입력" getShell().setText(Messages.titleQueryDataInsertDialog); //"질의데이터입력" setTitle(Messages.titleQueryDataInsertHeader); //"Preparedstatement유형의SQL에CSV데이터를제공하여SQL을실행할수있습니다." setMessage(Messages.titleQueryDataInsertHeaderMsg); com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 DialogUI구현 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog //SQL입력폼 { Labellbl=newLabel(parent,SWT.NONE); lbl.setText(Messages.lblSql);//"SQL" GridDatagd=newGridData(SWT.FILL,SWT.FILL,false,false); gd.verticalAlignment=GridData.BEGINNING; lbl.setLayoutData(gd); } txtSql=newText(parent,SWT.BORDER|SWT.MULTI|SWT.V_SCROLL); txtSql.setText(sql); { GridDatagd=newGridData(SWT.FILL,SWT.FILL,true,false); gd.horizontalSpan=3; gd.heightHint=80; txtSql.setLayoutData(gd); } com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 DialogUI구현 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog //입력파일선택폼 newLabel(parent,SWT.NONE).setText(Messages.lblCsvFile);//"입력파일" txtFilename=newText(parent,SWT.BORDER); txtFilename.setText(""); txtFilename.addModifyListener(newModifyListener(){ @Override publicvoidmodifyText(ModifyEventevent){ btnPreview.setEnabled(txtFilename.getText().length()>0); } }); { GridDatagd=newGridData(SWT.FILL,SWT.FILL,true,false); txtFilename.setLayoutData(gd); } com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 DialogUI구현 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog //CSV찾아보기버튼 ButtonbtnSelectFile=newButton(parent,SWT.PUSH); btnSelectFile.setText(Messages.lblBrowse);//"찾아보기..." btnSelectFile.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ FileDialogdlgFile=newFileDialog(getShell(),SWT.OPEN); dlgFile.setFilterExtensions(newString[]{"*.csv"}); Stringfilepath=dlgFile.open(); if(filepath!=null){ txtFilename.setText(filepath); } } }); //미리보기버튼 btnPreview=newButton(parent,SWT.PUSH); btnPreview.setText(Messages.lblPreview);//"미리보기" btnPreview.setEnabled(true);//TODO btnPreview.addSelectionListener(newSelectionAdapter(){ publicvoidwidgetSelected(finalSelectionEvente){ doPreview(); } }); com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 DialogUI구현 publicclassQueryDataInsertDialogextendsCMTitleAreaDialog //미리보기테이블 tbvPreviewer=newTableViewer(parent,SWT.BORDER); { GridDatagd=newGridData(SWT.FILL,SWT.FILL,true,false); gd.horizontalSpan=4; gd.heightHint=120; tbvPreviewer.getTable().setLayoutData(gd); } com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.3UI설계및구현 CSV파일선택대화창 org.eclipse.swt.widgets.FileDialog FileDialogdlgFile=newFileDialog(getShell(),SWT.OPEN); dlgFile.setFilterExtensions(newString[]{"*.csv"}); Stringfilepath=dlgFile.open(); if(filepath!=null){ ... } 5.3UI설계및구현 Action클래스작성 publicclassQueryDataInsertActionextendsSelectionAction com.cubrid.cubridmanager.ui.spi.action.SelectionAction publicstaticfinalStringID=QueryDataInsertAction.class.getName(); publicQueryDataInsertAction(Shellshell,Stringtext,ImageDescriptoricon) publicbooleanallowMultiSelections() publicbooleanisSupported(Objectobj) publicvoidrun() 소스파일참조 com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertAction.java 5.3UI설계및구현 네비게이션에컨텍스트메뉴추가 com.cubrid.cubridmanager.ui.spi.ActionBuilder privateIActionqueryDataInsertAction=null; ... publicvoidmakeActions(IWorkbenchWindowwindow){ ... queryDataInsertAction=newQueryDataInsertAction(window.getShell(), "질의데이터입력", CubridManagerUIPlugin.getImageDescriptor("icons/action/table_record_insert.png")); ActionManager.getInstance().registerAction(queryDataInsertAction); ... } 질의데이터입력Dialog출력을위한액션을초기화 com.cubrid.cubridmanager.ui.spi.ActionBuilder.java 5.3UI설계및구현 네비게이션에컨텍스트메뉴추가 com.cubrid.cubridmanager.ui.spi.ActionManager publicvoidsetActionsMenu(IMenuManagermanager){ ... caseTABLE_FOLDER: addActionToManager(manager,getAction(NewTableAction.ID)); addActionToManager(manager,getAction(QueryDataInsertAction.ID)); break; ... } 네비게이션의테이블폴더영역의컨텍스트메뉴에 ActionBuilder에초기화된액션을바인딩 com.cubrid.cubridmanager.ui.spi.ActionManager.java 5.4기능구현 QueryDataInsertDialg주요메소드 publicQueryDataInsertDialog(Shellshell,DatabaseInfodbInfo) •대화창의생성자 •DatabaseInfo객체를받아서대상테이블의컬럼정보를확인하고데이터베이스 접속객체(Connection)를초기화하기위해사용 com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java 5.4기능구현 QueryDataInsertDialg주요메소드 protectedControlcreateDialogArea(Compositeparent) •대화창제목초기화 •대화창헤더영역제목및설명초기화 •동적도움말초기화 •parent하부의컴포지트초기화 com.cubrid.cubridmanager.ui.cubrid.table.action.QueryDataInsertDialog.java

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    118 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us