KR100505111B1 - The apparatus and method of creating program source for operating database and the computer program product using the same - Google Patents

The apparatus and method of creating program source for operating database and the computer program product using the same Download PDF

Info

Publication number
KR100505111B1
KR100505111B1 KR10-2002-0060345A KR20020060345A KR100505111B1 KR 100505111 B1 KR100505111 B1 KR 100505111B1 KR 20020060345 A KR20020060345 A KR 20020060345A KR 100505111 B1 KR100505111 B1 KR 100505111B1
Authority
KR
South Korea
Prior art keywords
program source
database
program
information
file
Prior art date
Application number
KR10-2002-0060345A
Other languages
Korean (ko)
Other versions
KR20040029898A (en
Inventor
윤영식
이명진
이경우
서경란
Original Assignee
가림정보기술(주)
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 가림정보기술(주) filed Critical 가림정보기술(주)
Priority to KR10-2002-0060345A priority Critical patent/KR100505111B1/en
Publication of KR20040029898A publication Critical patent/KR20040029898A/en
Application granted granted Critical
Publication of KR100505111B1 publication Critical patent/KR100505111B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

본 발명은 데이터베이스에 관한 정보를 취득하여 데이터베이스에 대한 연산을 실행하는 프로그램 소스 생성 장치 및 그 방법에 관한 것이다. 이를 위하여 본 발명의 프로그램 소스 생성 장치는 CPU와, 데이터에 대한 정보를 기록한 정보파일을 포함하는 데이터저장유닛으로 이루어지며, 이러한 프로그램 소스 생성 장치를 이용한 본 발명의 프로그램 소스 생성 방법은 데이터베이스의 접속 정보 및 소스 생성 제어 정보를 얻는 단계, 데이터베이스의 메타데이터를 수집하는 단계, 템플릿 파일을 로딩하는 단계, 그리고 프로그램 소스를 생성하는 단계를 포함한다. 이와 같이 생성된 본 발명의 프로그램 소스를 이용함으로써 프로그램 개발자는 단순 반복 작업을 행하지 않고도 보다 손쉽게 데이터베이스에 대한 연산을 실행하는 시스템을 개발할 수 있다.The present invention relates to an apparatus and method for generating a program source for acquiring information on a database and performing operations on the database. To this end, the program source generating apparatus of the present invention comprises a data storage unit including a CPU and an information file that records information about data. The program source generating method of the present invention using the program source generating apparatus includes connection information of a database. And obtaining source generation control information, collecting metadata of a database, loading a template file, and generating a program source. By using the program source of the present invention generated as described above, a program developer can easily develop a system that executes operations on a database without performing a simple repetitive task.

Description

데이터베이스 연산용 프로그램 소스 생성 장치 및 그 방법과 이를 이용한 컴퓨터 프로그램 제품 {THE APPARATUS AND METHOD OF CREATING PROGRAM SOURCE FOR OPERATING DATABASE AND THE COMPUTER PROGRAM PRODUCT USING THE SAME}A device for generating a database source for a database operation, a method thereof, and a computer program product using the same, and the method of the computer program using the same.

본 발명은 데이터베이스에 대한 정보를 수집하여 데이터베이스의 데이터에 대한 연산을 수행하는 프로그램 소스 생성 장치 및 그 방법에 관한 것으로, 더욱 상세하게는 데이터베이스에 접속하여 데이터베이스의 스키마를 수집한 후, 데이터베이스의 테이블 또는 뷰에 대한 검색, 삽입, 삭제, 변경 등의 기본 연산을 수행하는 클래스 프로그램 소스 및 마이그레이션 프로그램 소스를 생성하기 위한 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for generating a program source for performing operations on data of a database by collecting information about a database. More particularly, the present invention relates to a table of a database after collecting a schema of a database by accessing a database. An apparatus and method for generating a class program source and a migration program source that perform basic operations such as searching, inserting, deleting, and changing a view.

현대 사회의 모든 기업은 대규모 전산시스템을 운영하면서 대량의 데이터를 포함한 데이터베이스를 사용하고 있다. 데이터베이스(database)라 함은 특정 조직의 여러 응용 시스템들이 공용할 수 있도록 통합 및 저장되어 있고, 내용에 쉽게 액세스하여 처리하고 갱신할 수 있도록 이루어진 데이터의 집합체를 말한다. 이러한 데이터베이스는 데이터를 저장하기 위하여 데이터를 저장하는 장소인 테이블(table)과 1개 이상의 테이블에 대해 필요한 정보를 정의한 논리적인 테이블인 뷰(view)라는 저장 단위를 제공하며, 각 저장단위의 데이터마다 검색(select), 삽입(insert), 삭제(delete), 변경(update) 등의 연산을 실행할 수 있도록 되어 있다. All companies in modern society operate large-scale computer systems and use databases containing large amounts of data. A database is a collection of data that is integrated and stored for common use by various application systems of a specific organization, and that is easily accessed, processed, and updated. Such a database provides a storage unit called a table, which is a place to store data in order to store data, and a view, which is a logical table that defines necessary information about one or more tables. It is possible to perform operations such as select, insert, delete, and update.

이러한 기본 연산을 응용하여 마이그레이션이라는 작업도 수행된다. 마이그레이션이라 함은, 데이터베이스의 데이터를 다른 데이터베이스로 옮기는 작업을 말하는 데, 데이터베이스로 시스템을 운영하거나 개발을 하다 보면 기존의 데이터베이스에 있는 데이터들을 다른 데이터베이스로 옮기는 작업이 필요하므로 많이 요구된다. 특히 옮길 원천이 되는 데이터베이스(이하 소스(source) 데이터베이스라고 함.)와 옮길 대상이 되는 데이터베이스[이하 목적(destination) 데이터베이스라고 함.]의 데이터베이스 구조 및 테이블의 구조가 일치하면 마이그레이션이 비교적 간단하지만, 소스 데이터베이스와 목적 데이터베이스의 구조가 서로 다르며, 심지어 DBMS(database management system, 데이터베이스 관리 시스템)까지 다른 경우에는 마이그레이션 작업이 상당히 복잡해지므로 마이그레이션용 프로그램 개발이 필요한 실정이다.By applying these basic operations, a task called migration is also performed. Migration refers to the operation of moving data from one database to another database. When operating or developing a system using a database, a migration is required because it requires moving data from an existing database to another database. In particular, if the database structure and the table structure of the database to be moved (hereinafter referred to as the source database) and the database to be moved to (hereafter referred to as the destination database) match, the migration is relatively simple. If the source database and the target database are different from each other and even the DBMS (database management system) is different, the migration task becomes complicated and it is necessary to develop a program for migration.

도 6은 사용자의 요구에 따른 데이터베이스의 연산 실행 과정을 개략적으로 나타내고 있다. 데이터베이스(2)에 대해서 사용자(7)가 데이터베이스(2)에 대한 특정 정보의 검색, 삽입, 삭제, 갱신 등의 요청을 하는 경우, 이러한 요청에 따라 데이터베이스(2)의 자체의 테이블 및 뷰로부터 사용자가 원하는 데이터 연산이 실행되어 그 결과가 사용자에게 제공된다. 이러한 정보를 제공받기 위하여 사용자는 데이터베이스에서 정보를 얻거나 갱신하기 위해 표준화된 언어(Structured Query Language, SQL)를 통하여 데이터베이스(2)에 정보 제공 및 변경을 요청하고, 이에 따라 데이터베이스(2)는 사용자의 요청 작업을 수행한 후 그 결과를 사용자에게 제공한다. 프로그램 개발자(6)는 데이터베이스 연산에 필요한 프로그램 소스를 코딩하여 제공한다.6 schematically illustrates a process of executing an operation of a database according to a user's request. When the user 7 makes a request to the database 2 for the retrieval, insertion, deletion, update, etc. of specific information on the database 2, the user from the tables and views of the database 2 itself according to such a request. The desired data operation is executed and the result is provided to the user. In order to be provided with this information, the user requests to provide and change the information in the database 2 through a standardized language (Structured Query Language, SQL) to obtain or update the information in the database. After performing the request operation, the result is provided to the user. The program developer 6 codes and provides a program source for database operation.

특히 오늘날에는 일반적으로 대다수의 데이터베이스에 데이터베이스 표준 라이브러리인 JDBC(Java Database Connectivity)가 제공되는 데, 여기서의 JDBC는 자바로 작성된 프로그램을 일반 데이터베이스에 연결하기 위한 응용프로그램 인터페이스 규격을 말한다. 이러한 응용프로그램 인터페이스는 데이터베이스 관리시스템에 넘겨질 SQL 형태의 데이터베이스 접근 요구 문장을 각 시스템에 맞도록 바꾸어 주는 역할을 하며, 처리 결과도 이와 유사한 인터페이스를 통하여 얻게 된다. JDBC는 실제로 2계층의 인터페이스로 이루어져 있다. 즉, 주(主) 인터페이스 이외에 JDBC "manager"에서 나온 API(application program interface)가 있는데, API는 개별 데이터베이스 제품의 드라이버들과 차례로 통신하는 역할을 한다.In particular, today most databases are provided with a database standard library, Java Database Connectivity (JDBC), which refers to the application interface specification for connecting Java programs to common databases. This application program interface changes the database access request statements in SQL form to be passed to the database management system to suit each system, and the processing result is also obtained through a similar interface. JDBC actually consists of two layers of interfaces. In addition to the main interface, there is an application program interface (API) derived from the JDBC "manager", which in turn communicates with the drivers of individual database products.

JDBC는 프로그램 개발자가 SQL 요구를 만드는데 사용할 일련의 객체지향 프로그램의 클래스(class)들을 정의하고 있으며, 별도의 추가 클래스 모음집에 JDBC 드라이버 API가 기술되어 있다.JDBC defines a set of classes of object-oriented programs that program developers can use to make SQL requests. The JDBC driver API is described in a separate collection of additional classes.

이와 같이 JDBC에서 정의하고 있는 클래스는 일련의 객체지향 프로그래밍(object-oriented programming, OOP)을 통하여 이루어지는 데, 여기서의 클래스는 이러한 객체 지향형 프로그램에서 하나의 논리적 관리 단위인 객체를 구현하는 소스를 말한다.As such, classes defined in JDBC are made through a series of object-oriented programming (OOP), where the class refers to the source that implements an object, which is a logical management unit in such object-oriented programming.

객체지향 프로그래밍은 모든 객체와 이러한 객체들이 어떠한 연관성이 있는지를 식별한 다음, 식별 결과를 객체 클래스로 일반화하고 클래스가 포함하는 데이터의 종류와 이를 다룰 수 있는 모든 논리 순서를 정의한다. 따라서, 객체지향 프로그래밍에서는 클래스가 중요한 역할을 담당하며 다음과 같은 이점을 제공한다.Object-oriented programming identifies all objects and how they relate, then generalizes the identification results into object classes and defines the kind of data the class contains and any logical sequence that can handle them. Thus, in object-oriented programming, classes play an important role and provide the following benefits:

클래스 개념은 일부 또는 모든 주 클래스 특성을 공유하는 객체의 부 클래스를 정의할 수 있게 하며, 상속이라 불리는 이 객체지향 프로그래밍의 특성은 면밀한 자료 분석과 개발시간 단축, 그리고 좀더 정확한 코딩을 보증하는 효과가 있다. 또한 클래스는 단지 관련된 데이터만 정의하기 때문에, 그 클래스의 인스턴스가 수행될 때 다른 프로그램에서 사용하는 데이터를 건드릴 수 없다. 이러한 자료 숨김 특성은 높은 시스템 보안을 제공하고, 의도하지 않은 자료의 훼손을 방지한다. 그리고 클래스의 정의는 최초로 생성한 프로그램뿐 아니라 다른 객체지향 프로그래밍에 의해 재사용될 수 있으므로 네트워크에 쉽게 분산되어 사용된다. 이와 더불어, 클래스 개념은 언어에 정의되지 않은 새로운 데이터 형식을 프로그램 개발자가 임의로 정의할 수 있게 한다.The class concept allows you to define subclasses of objects that share some or all of the main class properties. This object-oriented programming feature, called inheritance, has the effect of ensuring careful data analysis, reduced development time, and more accurate coding. have. Also, because a class only defines relevant data, you cannot touch data used by other programs when an instance of that class is executed. This data hiding feature provides high system security and prevents unintended corruption of data. Class definitions are easily distributed across networks because they can be reused not only by the original program but also by other object-oriented programming. In addition, the class concept allows program developers to arbitrarily define new data types that are not defined in the language.

이러한 이점으로 인하여 객체 지향 프로그래밍 언어가 많이 사용되고 있는데, 자바(Java)는 기업이나 인터넷의 분산 응용프로그램에 사용되도록 설계된 객체 지향 프로그래밍 언어 중 하나이다. 자바는 특정한 컴퓨터 하드웨어나, 특정한 OS(Operating System)에 종속적이지 않고 자바가상머신이 수행될 수 있는 모든 컴퓨터 시스템에서 실행될 수 있으므로 자바로 개발한 응용 프로그램은 범용성 및 호환성을 가진다. 전술한 JDBC도 자바 랭귀지 라이브러리에 속하는 것으로서, 프로그램 개발자가 SQL을 코딩하는 경우 데이터베이스 표준 라이브러리인 JDBC를 사용하게 된다. JDBC는 특정한 DBMS에 종속적이지 않고 JDBC에서 규정한 API 드라이버를 제공하는 모든 DBMS에 사용될 수 있다.Because of these advantages, object-oriented programming languages are widely used. Java is one of the object-oriented programming languages designed to be used for distributed applications in corporations and the Internet. Java is not dependent on a specific computer hardware or a specific operating system (OS), and can be executed on any computer system in which a Java virtual machine can be executed. Therefore, an application developed in Java is versatile and compatible. JDBC described above also belongs to the Java language library, and when a program developer codes SQL, the database standard library JDBC will be used. JDBC is not dependent on a specific DBMS and can be used for any DBMS that provides an API driver defined by JDBC.

그런데, 사용자가 일일이 SQL을 코딩하여 JDBC를 기반으로 하는 데이터베이스에 원하는 정보를 요청 또는 변경하는 것이 현실상 불가능하므로, 데이터베이스의 데이터에 대한 연산을 실행하는 시스템을 개발하여 사용한다. 따라서, 도 6에 도시한 바와 같이, 프로그램 개발자(6)가 바로 이와 같은 데이터 연산에 필요한 프로그램 소스를 코딩하여 제공한다.However, since it is impossible in reality to request or change information required by a user by coding SQL in a JDBC-based database, a system for performing operations on data in the database is developed and used. Therefore, as shown in FIG. 6, the program developer 6 codes and provides a program source necessary for such data operation.

그러나 이러한 프로그램 소스의 코딩에 있어서는 다루어야 할 데이터 저장단위가 많을 경우, 각 저장단위별로 클래스를 생성시 각 저장단위에 포함된 컬럼(column)에 대해 Set/Get등의 함수, 각 컬럼의 각기 상이한 데이터형을 처리하는 함수, 검색의 결과가 1개 이상인 경우 검색결과 List를 관리하는 함수, 검색 연산을 실행하는 함수, 변경, 삽입, 삭제 등의 연산 실행하는 함수 등의 기본적인 함수를 각 저장단위마다 반복하여 일일이 만들어 주어야 하는 문제점이 있었다. 따라서 개발자가 일일이 반복적으로 코딩하는 경우 매우 복잡해지게 되어 정작 작성된 데이터베이스 연산 시스템에는 논리적인 오류가 있을 가능성이 매우 큰 문제점이 있다.However, in the coding of such program sources, when there are many data storage units to be dealt with, when creating a class for each storage unit, functions such as Set / Get for columns included in each storage unit, and different data for each column Repeat basic functions for each storage unit, such as a function that handles types, a function that manages a list of search results when there is more than one result, a function that performs a search operation, and a function that performs operations such as change, insert, and delete There was a problem that must be made one by one. Therefore, when developers repeatedly code one by one, it becomes very complicated, and there is a big problem that there is a possibility that there is a logical error in the database calculation system.

이러한 기본적인 연산 이외에도 대량의 저장단위에 대한 마이그레이션 및 서로 다른 데이터베이스 시스템간에 마이그레이션이 이루어지는 경우, 수작업으로는 불가능한 경우가 많을 뿐만 아니라, 마이그레이션 작업이 지속적으로 이루어 지는 것이 아니라 개발 기간 및 운용 초기에 1~2번만 수행되기 때문에 마이그레이션을 위한 프로그램을, 프로그램 개발자가 손수 작성하는 것은 시간과 비용 측면에서 비효율적이다.In addition to these basic operations, when migrating large storage units and migrating between different database systems, it is often impossible to do it manually, and the migration is not continuously performed. Since it is done only once, writing the program for migration by the program developer is inefficient in terms of time and cost.

본 발명은 이와 같은 문제점을 해결하기 위한 것으로, 프로그램 개발자를 위하여 데이터베이스의 데이터에 대한 기본 연산 및 마이그레이션을 실행하는 프로그램 소스를 자동으로 생성해 줌으로써, 프로그램 개발자가 데이터베이스 저장단위에 대한 기본 연산 및 마이그레이션 작업에 대해 프로그램 소스를 코딩할 필요성을 없애줄 뿐만 아니라, 데이터베이스 스키마를 참조하여 프로그램 개발자가 작업 소스를 생성할 때 발생할 수 있는 오류를 완전히 제거하고자 한다. The present invention is to solve such a problem, by automatically generating a program source for performing a basic operation and migration of the data in the database for the program developer, the program developer to the basic operation and migration operations for the database storage unit In addition to eliminating the need to code the program source for, we want to refer to the database schema to completely eliminate errors that can occur when program developers create work sources.

또한 본 발명은 데이터베이스의 스키마가 변경되었을 경우 관련된 프로그램의 소스를 모두 변경하던 방법을 탈피하여 데이터베이스의 스키마가 변경되었을 경우 변경이 필요한 부분에 대해 자동으로 변경된 내용의 소스를 생성해 줌으로써 프로그램 개발자의 프로그램 개발 기간을 단축하고 오류를 완전히 제거할 수 있도록 하고자 한다. In addition, the present invention is a program developer program by creating a source of the changed content automatically for the portion that needs to be changed when the schema of the database is changed, when the schema of the database is changed, and all the source of the associated program is changed. We want to reduce development time and eliminate errors completely.

그리고 본 발명은 마이그레이션용 프로그램 소스 생성 방법을 부가적으로 제공함으로써, 프로그램 개발자가 손쉽게 기존의 데이터베이스에 있는 데이터를 다른 데이터베이스로 손쉽게 옮길 수 있도록 하게 해주고자 한다.In addition, the present invention additionally provides a program source generation method for migration, so that a program developer can easily move data in an existing database to another database.

이와 같은 본 발명의 목적을 달성하기 위하여 본 발명의 데이터베이스에 대한 연산을 수행하는 프로그램 소스 생성 장치는 프로그램 소스 생성에 필요한 파일을 저장하는 데이터저장유닛 및 이러한 데이터저장유닛의 파일들에 대한 명령을 수행하는 CPU(central processing unit)를 포함한다. 여기서 데이터저장유닛은, 데이터베이스에 대한 접속 정보를 저장하는 데이터베이스 접속정보파일, 프로그램 소스 생성에 필요한 정보를 저장하는 프로그램 소스 생성정보파일, 기설정된 프로그램 소스를 저장하고 이를 바탕으로 하여 프로그램 소스 생성에 필요한 정보에 따라 프로그램을 생성하기 위한 템플릿(template) 파일, 메타데이터를 수집하고 프로그램 소스 생성에 적용되는 라이브러리를 포함하는 라이브러리 파일 그리고 프로그램소스 생성정보파일에 저장된 프로그램소스 생성정보에 따라 템플릿 파일 중 하나 이상의 변수값을 상기 메타데이터에 관한 문자열로 치환함으로써 생성되는 프로그램 소스파일을 포함한다.In order to achieve the object of the present invention, a program source generating apparatus for performing operations on a database of the present invention performs a data storage unit for storing files necessary for generating a program source, and commands for files of the data storage unit. It includes a central processing unit (CPU). Here, the data storage unit stores a database connection information file for storing connection information for a database, a program source generation information file for storing information necessary for generating a program source, and a predetermined program source for storing a program source based thereon. One or more of a template file for generating a program according to the information, a library file including a library for collecting metadata and generating a program source, and a program source generation information stored in the program source generation information file. A program source file generated by substituting a variable value with a string for said metadata.

또한, 본 발명의 프로그램 소스 생성 장치는 데이터저장유닛에 생성된 프로그램 소스에 따라 마이그레이션(migration)을 실행하기 위한 마이그레이션용 정보 파일을 추가로 포함할 수 있다.In addition, the program source generating apparatus of the present invention may further include a migration information file for executing migration according to the program source generated in the data storage unit.

데이터베이스에 대한 연산을 수행하는 본 발명의 프로그램 소스 생성 방법은, 데이터베이스의 접속 정보를 가져오는 단계, 데이터베이스에 대한 프로그램 소스 생성에 필요한 프로그램 소스 생성 정보를 가져오는 단계, 데이터베이스의 메타데이터를 수집하는 단계, 프로그램 소스 생성에 필요한 기설정된 프로그램 소스를 포함하는 템플릿 파일을 로딩하는 단계 및 프로그램 소스 생성 정보에 따라 템플릿 파일의 기설정된 프로그램 소스 중 하나 이상의 변수값을 메타데이터에 관한 문자열로 치환하여 프로그램 소스를 생성하는 단계를 포함한다.The program source generation method of the present invention performing an operation on a database includes: obtaining access information of a database, obtaining program source generation information necessary for generating a program source for a database, and collecting metadata of the database; Loading a template file including a predetermined program source necessary for generating a program source, and replacing one or more variable values of a predetermined program source of the template file with a string about metadata according to the program source generation information. Generating.

본 발명의 프로그램 소스 생성 방법에서 데이터베이스의 접속 정보를 가져오는 단계는 접속시에 사용하는 드라이버(driver), URL(uniform resource locator), 사용자 ID, 사용자 패스워드, 초기설정 데이터베이스 접속개수, 최대설정 데이터베이스 접속개수, 그리고 타임아웃(timeout) 발생 최대시간을 포함하고, 스크립트(script) 파일 형태로 저장되어 있는 데이터베이스 접속 정보 파일을 로딩하여 데이터베이스 접속 정보를 추출할 수 있다.In the program source generation method of the present invention, the step of obtaining database connection information includes a driver, a URL (uniform resource locator), a user ID, a user password, an initial database connection number, and a maximum database configuration connection. The database connection information may be extracted by loading the database connection information file stored in the form of a script file including the number and the maximum timeout time.

또한 본 발명의 프로그램 소스 생성 방법에서 데이터베이스의 프로그램 소스 생성 정보를 가져오는 단계는 소스 생성 대상의 범위 및 종류, 패키지 이름, 클래스 이름, 결과의 정렬, 그리고 쿼리의 구조에 관한 정보를 포함하며, 스크립트 파일 형태로 저장되어 있는 프로그램 소스 생성 정보 파일을 로딩하여 프로그램 소스 생성 정보를 추출할 수 있다.Also, in the program source generation method of the present invention, the step of obtaining program source generation information of the database includes information on the scope and type of the source generation target, the package name, the class name, the sorting of the results, and the structure of the query. The program source generation information may be extracted by loading the program source generation information file stored in the file form.

또한 본 발명의 프로그램 소스 생성 방법에서 메타데이터를 수집하는 단계는, 데이터베이스의 메타데이터, 테이블 메타데이터 및 컬럼 메타데이터를 수집하고, 데이터베이스에서 메타데이터를 수집하여 프로그램 소스 생성 정보를 추출할 수 있다.In the collecting of the metadata in the program source generation method of the present invention, the metadata of the database, the table metadata and the column metadata may be collected, and the metadata may be collected from the database to extract the program source generation information.

본 발명의 프로그램 소스 생성 방법에 따라 마이그레이션용 프로그램 소스를 생성하는 방법은, 프로그램이 마이그레이션용 스크립트 파일을 분석하는 단계, 프로그램에 따라 소스 데이터베이스의 프로그램 소스를 생성하는 단계, 프로그램에 따라 목적(destination) 데이터베이스의 프로그램 소스를 생성하는 단계, 그리고 소스 데이터베이스 프로그램과 상기 목적 데이터베이스 프로그램을 매핑(mapping)하는 프로그램 소스를 생성하는 단계를 포함한다.The method for generating a program source for migration according to the program source generation method of the present invention includes the steps of: analyzing a script file for migration, generating a program source of a source database according to a program, and destination according to the program. Generating a program source of a database, and generating a program source for mapping a source database program with the target database program.

그리고 본 발명의 컴퓨터 프로그램 제품은 이러한 본 발명의 프로그램 소스 생성 방법을 실행하기 위한 일련의 명령을 포함하며, 이러한 일련의 명령에 포함되는 명령어를 제공하는 라이브러리를 추가로 포함할 수 있다.The computer program product of the present invention includes a series of instructions for executing the program source generation method of the present invention, and may further include a library for providing instructions included in the series of instructions.

본 발명의 실시예를 첨부한 도면을 참조하여 이하에 설명한다. 동일한 부분에는 동일한 도면 부호를 사용하여 설명을 생략한다.Embodiments of the present invention will be described below with reference to the accompanying drawings. The same reference numerals are used for the same parts, and the description is omitted.

도 1은 본 발명의 전체적인 개념을 나타내는 개략적인 도면으로서, 본 발명의 데이터베이스 연산용 프로그램 소스 생성 개요를 나타낸다. 도1에 나타낸 바와 같이, 본 발명의 프로그램 소스 생성기(1)는 스크립트 파일(3)로부터 데이터베이스에 대한 접속 정보 및 프로그램 소스 생성에 필요한 제어 정보를 제공받고, 데이터베이스(2)로부터 메타 데이터를 제공받는다. 본 발명의 프로그램 소스 생성기(1)는 이와 같이 제공받은 정보를, 템플릿 파일(4)을 로딩하여 템플릿 파일(4)의 대응되는 특정표시 부분과 자동으로 치환함으로써 소스 파일(5)을 생성한다. 이와 같이 생성된 소스 파일(5)은 데이터베이스를 이용하는 프로그램 개발자들에게 제공되어 데이터베이스의 연산에 필요한 프로그램의 코딩 작업을 돕는다. 프로그램 개발자들은 이러한 과정을 통하여 제작된 프로그램 소스를 사용하여 데이터베이스 연산을 실행하는 시스템을 개발하여 사용자에게 제공하며, 사용자는 이러한 데이터베이스 연산 시스템을 이용하여 데이터베이스에 대한 연산을 행할 수 있다.1 is a schematic diagram showing the overall concept of the present invention, showing an overview of generating a program source for a database operation of the present invention. As shown in Fig. 1, the program source generator 1 of the present invention is provided with access information about a database and control information necessary for generating a program source from a script file 3, and metadata is provided from a database 2. . The program source generator 1 of the present invention generates the source file 5 by loading the template file 4 and automatically replacing it with the corresponding specific display portion of the template file 4. The generated source file 5 is provided to program developers who use the database to help in coding the programs necessary for the operation of the database. Program developers develop and provide a system for executing a database operation using a program source produced through this process to a user, the user can perform operations on the database using this database operation system.

전술한 메타 데이터는 데이터에 대한 정의나 설명이 되어 있는 것을 말하며, 관련된 데이터나 정보를 포함하는 보다 포괄적이나 근원적인 데이터를 말한다. 본 발명의 프로그램 소스 생성기(1)가 수집하는 메타 데이터는 데이터베이스의 스키마 정보로서 데이터베이스 메타 정보, 테이블 메타 정보 및 컬럼 메타 정보가 포함되며, 데이터베이스로부터 수집되어 프로그램 소스 생성에 이용된다. 본 발명에서는 자체 제작한 라이브러리를 사용하여 데이터베이스로부터 메타 데이터를 수집하며, 이러한 라이브러리는 본 발명의 프로그램 소스 생성기(1)에 제공되어 프로그램 소스 생성에 이용된다.The above-mentioned metadata refers to a definition or description of data, and refers to more comprehensive or original data including related data or information. The meta data collected by the program source generator 1 of the present invention includes database meta information, table meta information, and column meta information as schema information of a database, and is collected from a database and used for generating a program source. In the present invention, the self-produced library is used to collect metadata from a database. The library is provided to the program source generator 1 of the present invention and used for generating the program source.

특히 본 발명의 프로그램 소스 생성기(1)는 JDBC를 지원하는 모든 데이터베이스에서 사용할 수 있도록 되어 있으며, OS(operating system, 운영체제)의 종류에 관계없이 사용이 가능하다. 또한 ODBC(open database connectivity)를 지원하는 데이터베이스에서도 사용이 가능하므로 범용성이 뛰어나다. 특히, 널리 사용되고 있는 DBMS(Oracle, Informix, MS SQL Server, MySQL)에서는 모두 JDBC 드라이버를 제공하고 있으므로 본 발명의 프로그램 제품은 특정 DBMS에 종속된 것이 아니라 범용 DBMS에 사용될 수 있다는 이점이 있다.In particular, the program source generator 1 of the present invention can be used in any database that supports JDBC, and can be used regardless of the type of OS (operating system). It can also be used in databases that support open database connectivity (ODBC), which makes it very versatile. In particular, since widely used DBMS (Oracle, Informix, MS SQL Server, MySQL) provides a JDBC driver, the program product of the present invention can be used for general purpose DBMS, not dependent on a specific DBMS.

도 2는 전술한 도 1의 프로그램 생성기를 구조를 나타내는 블록도이다. 도 2에 나타낸 바와 같이 본 발명의 프로그램 생성기(1)는 CPU(central processing unit, 중앙처리장치)(22) 및 데이터저장유닛(24)을 포함하며, 입력장치(21) 및 표시 장치(25)는 CPU(22)와 연결되어 데이터에 관한 정보를 입력받아 가공하여 출력한다.FIG. 2 is a block diagram illustrating a structure of the program generator of FIG. 1 described above. As shown in FIG. 2, the program generator 1 of the present invention includes a CPU (central processing unit) 22 and a data storage unit 24, and includes an input device 21 and a display device 25. Is connected to the CPU 22 receives the information about the data and processes and outputs.

CPU(22)는 생성된 데이터의 연산 결과를 임시로 저장하는 메모리(23)을 포함하며, 데이터저장유닛(24)은 데이터베이스 접속정보파일(241), 프로그램소스 생성정보파일(242), 템플릿 파일(243), 라이브러리 파일(244) 및 생성된 프로그램소스파일(243)을 포함한다.The CPU 22 includes a memory 23 that temporarily stores the calculation result of the generated data, and the data storage unit 24 includes a database connection information file 241, a program source generation information file 242, and a template file. (243), the library file 244 and the generated program source file (243).

프로그램 개발자들은 데이터베이스 접속정보파일(241)에 접속할 데이터베이스의 IP주소 및 사용자 ID, 비밀번호 등을 저장하며, 프로그램소스 생성정보파일(242)에는 생성될 프로그램 소스가 어떠한 내용을 포함할 것이며, 어떤 저장단위에 대한 프로그램 소스를 생성할 것인지에 대한 프로그램 소스 생성 정보가 스크립트 파일로 저장되어 있다. 템플릿 파일(243)은 검색, 삽입, 삭제, 변경 등의 기설정된 프로그램 소스를 제공하는 역할을 담당한다. 라이브러리 파일(244)은 전술한 바와 같이 데이터베이스의 메타데이터 수집이나 프로그램 소스 생성 등에 이용되는 라이브러리를 저장하며, 생성된 프로그램소스파일(245)은 소스 생성 프로그램의 실행 결과로 생성되는 데이터베이스 연산프로그램소스를 저장한 파일을 말한다.Program developers store the IP address, user ID, password, etc. of the database to access the database access information file 241, the program source generation information file 242, which content will be included in the program source to be generated, what storage unit Program source creation information about whether to generate a program source for the program is stored as a script file. The template file 243 is responsible for providing a predetermined program source such as search, insertion, deletion, and change. As described above, the library file 244 stores a library used for collecting metadata of a database, generating a program source, and the like, and the generated program source file 245 stores a database operation program source generated as a result of executing a source generation program. Speak the saved file.

또한 도 2에 도시하지는 않았지만, 본 발명의 프로그램 생성기(1)는 마이그레이션용 정보파일을 포함할 수도 있다. 마이그레이션용 정보파일은 검색, 삽입, 삭제, 변경 등의 기본 연산을 바탕으로 하여 마이그레이션을 행하는 경우의 정보를 포함하고 있다. 이러한 본 발명의 프로그램 생성기(1)의 구조는 단지 본 발명을 예시하기 위한 것이며, 본 발명이 여기에 한정되는 것은 아니다.Although not shown in Fig. 2, the program generator 1 of the present invention may also include an information file for migration. The information file for migration contains information when migrating based on basic operations such as searching, inserting, deleting, and changing. The structure of the program generator 1 of the present invention is merely for illustrating the present invention, and the present invention is not limited thereto.

도 3에서는 본 발명의 전체적인 흐름에 대하여 좀더 자세하게 설명한다. 도 3은 본 발명의 데이터베이스 연산용 프로그램 소스 생성 방법을 나타내는 전체적인 흐름도로서, 데이터베이스로부터 제공받은 정보에 따라 데이터를 연산하여 필요한 프로그램 소스를 생성하는 과정을 나타낸 도면이다.3 will be described in more detail with respect to the overall flow of the present invention. FIG. 3 is an overall flowchart illustrating a method of generating a program source for database operation of the present invention, and illustrates a process of generating a necessary program source by calculating data according to information provided from a database.

이러한 본 발명의 데이터베이스 연산용 프로그램 소스 생성 방법은 전체적으로 볼 때, 스크립트 파일로부터 필요한 정보를 얻는 과정(S2, S3), 데이터베이스의 스키마를 수집하는 과정(S4 내지 S7), 프로그램 소스 생성에 관련된 과정(S8, S9)으로 이루어져 있다. 이러한 본 발명의 프로그램 소스 생성에 있어서의 전체적인 과정을 각 단계에 따라 좀더 세분화하여 설명한다.Such a method for generating a database operation program source of the present invention generally includes the steps of obtaining necessary information from a script file (S2 and S3), collecting a schema of a database (S4 to S7), and a process related to generating a program source ( S8, S9). The overall process of generating a program source of the present invention will be described in more detail according to each step.

먼저 도 3에 나타낸 바와 같이, 단계(S1)에서는 프로그램이 구동되어 본 발명의 전체적인 과정이 시작된다. 프로그램이 구동된 후, 단계(S2)에서는 해당 데이터베이스정보 파일을 로딩하여 데이터베이스 접속에 대한 정보를 얻는다. 이러한 데이터베이스의 접속 정보는 데이터베이스의 DBMS 접속에 필요한 정보를 제공해준다. DBMS에서는 ID에 따라 정해진 권한에 기초하여 데이터베이스에 대한 메타 데이터를 제한하여 제공한다.First, as shown in FIG. 3, in step S1, the program is driven to start the whole process of the present invention. After the program is run, in step S2, the database information file is loaded to obtain information about the database connection. This database connection information provides the information necessary for database DBMS connection. DBMS provides limited metadata for the database based on the authority determined by ID.

다음으로 단계(S3)에서는 프로그램 소스 생성 제어 정보 파일을 로딩하여 프로그램소스의 생성에 필요한 정보를 얻는다. 이러한 정보에는 프로그램 소스 생성 대상의 범위와 종류, 패키지 이름, 클래스 이름, 결과의 정렬, 그리고 쿼리에 대한 정보가 포함된다. 그 다음에는 데이터베이스의 데이터에 대한 연산을 위하여 데이터베이스의 스키마를 수집한다.Next, in step S3, the program source generation control information file is loaded to obtain information necessary for generation of the program source. This information includes the scope and type of program source generation target, package name, class name, sorting of results, and information about the query. Next, collect the schema of the database to operate on the data in the database.

구체적으로는 단계(S4)에서 프로그램 소스 생성 제어 정보에 따라 모든 테이블 또는 모든 뷰에 대한 스키마를 수집하고자 하는 경우, 단계(S5)에서 데이터베이스의 테이블 및 뷰에 대한 이름 메타데이터를 수집한다. 특정 테이블 또는 모든 뷰에 대한 메타데이터를 수집하고자 하는 경우 단계(S6)에서 원하는 테이블 및 뷰에 대한 기본키 또는 참조키 메타데이터를 수집한다. 각각의 테이블 및 뷰에 대한 데이터 수집이 완료되면 단계(S7)에서는 이러한 테이블 및 뷰의 컬럼에 대한 메타데이터를 수집한다. 이러한 테이블, 뷰마다 단계(S6 내지 S10)에서 프로그램 소스 생성이 반복된다.Specifically, in step S4, when the schema for all tables or all views is to be collected according to the program source generation control information, in step S5, name metadata for tables and views of the database is collected. If you want to collect metadata for a specific table or all views in step S6 to collect the primary key or reference key metadata for the desired table and view. When data collection for each table and view is completed, step S7 collects metadata about the columns of these tables and views. The program source generation is repeated in steps S6 to S10 for each of these tables and views.

단계(S8)에서는 수집된 데이터를 가공하기 위하여 미리 저장된 템플릿 파일을 로딩한다. 전술한 바와 같이 템플릿 파일에는 검색, 삽입, 삭제, 변경 등의 연산을 실행하기 위해 기설정된 프로그램 소스가 저장되어 있다.In step S8, a pre-stored template file is loaded in order to process the collected data. As described above, the template file stores a predetermined program source for executing operations such as searching, inserting, deleting, and changing.

단계(S9)에서는 프로그램 소스 생성 제어 정보를 바탕으로 하여 단계(S8)에서 로딩한 템플릿 파일의 특정 부분을 앞서 수집한 메타데이터로 치환하여 프로그램 소스를 생성한다.In step S9, the program source is generated by replacing a specific portion of the template file loaded in step S8 with the previously collected metadata based on the program source generation control information.

단계(S10)에서는 모든 테이블 또는 모든 뷰에 대한 프로그램소스 생성시 처리해야할 테이블 또는 뷰가 또 있는지 검사한다. 즉, 데이터베이스의 메타데이터 수집에서 모든 테이블 또는 모든 뷰의 이름을 가져왔으므로 이들의 이름별로 하나하나씩 처리하기 위해서 다시 단계(S6)로 진행한다. 프로그램 소스를 생성할 테이블 또는 뷰가 더 이상 없는 경우에는 단계(S11)에서 프로그램을 종료한다.In step S10, it is checked whether there is another table or view to be processed when generating a program source for all tables or all views. That is, since the names of all tables or all views are taken from the metadata collection of the database, the process proceeds to step S6 again to process one by one of their names. If there are no more tables or views for generating the program source, the program ends in step S11.

이하에서는 도 3에 도시한 본 발명의 전체적인 과정을 좀더 세분화하여 자세하게 설명한다.Hereinafter, the overall process of the present invention shown in FIG. 3 will be described in more detail.

먼저 단계(S2)에서의 데이터베이스 접속 정보 로딩에 대하여 아래의 프로그램 리스트 1을 참조하여 설명한다. 리스트 1은 데이터베이스 접속정보의 한 예를 나타낸다. 이와 같은 리스트 1의 데이터 접속정보는 본 발명을 예시하기 위한 것이며, 본 발명이 여기에 한정되는 것은 아니다.First, the database connection information loading in step S2 will be described with reference to program list 1 below. Listing 1 shows an example of database connection information. Such data connection information in List 1 is for illustrating the present invention, but the present invention is not limited thereto.

리스트 1List 1

리스트 1에 코딩한 바와 같이, 데이터베이스 접속정보 파일에는 접속시에 사용하는 드라이버(라인 5), URL(uniform resource locator)(라인 6), 사용자 ID(라인 7), 사용자 패스워드(라인 8), 초기 설정 데이터베이스 접속 개수(라인 9), 최대 설정가능한 데이터베이스 접속 개수(라인 10) 및 Timeout 발생 최대시간(라인 12) 등에 대한 내용이 기재될 수 있다. 이러한 접속 정보에 기초하여 데이터베이스에 접속한 다음, 프로그램 소스 생성 과정을 수행할 수 있다.As coded in Listing 1, the database connection information file includes a driver (line 5), a URL (uniform resource locator) (line 6), a user ID (line 7), a user password (line 8), and an initial file used for the connection. The number of setting database connections (line 9), the maximum settable database connections (line 10), and the maximum timeout occurrence time (line 12) may be described. After accessing the database based on the access information, a program source generation process may be performed.

이러한 접속 정보를 제공받은 후에는 다음의 리스트 2에서 보는 바와 같이 도 3의 단계(S2)에 도시한 프로그램 소스 생성 제어 정보를 가져와 프로그램 소스 생성에 대한 정보를 설정한다. 다음의 리스트 2는 본 발명의 프로그램 소스 생성 제어 정보 파일을 예시하기 위한 것이며, 본 발명이 여기에 한정되는 것은 아니다.After receiving the access information, as shown in Listing 2 below, the program source generation control information shown in step S2 of FIG. 3 is taken to set information on the program source generation. The following Listing 2 is for illustrating the program source generation control information file of the present invention, but the present invention is not limited thereto.

리스트 2List 2

리스트 2에 나타낸 바와 같이 본 발명의 소스 생성 제어 정보는 프로그램 소스생성에 대한 제어 정보를 기술한 스크립트 파일로 되어 있다. 즉, 리스트 2의 라인 11 내지 21는 생성해야 할 프로그램 소스가 전체 테이블에 관련된 것인지, 전체 뷰에 관련된 것인지, 하나의 테이블인지, 그리고 검색 쿼리인지 여부를 지정하는 것이고, 라인 37 내지 41은 생성된 프로그램 소스에서 검색을 할 경우 적용되는 결과의 정렬 방법을 정의하는 부분쿼리(Order By 절)를 지정한 것이다. 또한, 라인 56 내지 64는 생성해야 할 프로그램 소스가 검색 쿼리인 경우 검색쿼리를 지정한 것이다.As shown in Listing 2, the source generation control information of the present invention is a script file that describes the control information for program source generation. That is, lines 11 through 21 of Listing 2 specify whether the program source to be generated is related to the entire table, the entire view, one table, and a search query, and lines 37 to 41 are generated. Specify a partial query (Order By clause) that defines how to sort the results when searching from the program source. Also, lines 56 to 64 designate a search query when the program source to be generated is a search query.

이와 같이 소스 생성 제어 정보를 제공받은 다음, 도3의 단계(S4)에서 생성해야할 프로그램 소스가 전체 테이블 또는 전체 뷰에 관련된 경우, 도 3의 단계(S5)에서 데이터베이스의 메타데이터를 수집한다. 데이터베이스의 메타데이터 수집에 있어서는 데이터베이스내의 모든 테이블 또는 모든 뷰들의 이름을 수집한다. After receiving the source generation control information as described above, when the program source to be generated in step S4 of FIG. 3 relates to the entire table or the entire view, metadata of the database is collected in step S5 of FIG. 3. In collecting metadata of a database, collects the names of all tables or all views in the database.

또한, 도 3의 단계(S6)에서는 테이블 또는 뷰의 기본키 또는 참조키 메타데이터를 수집한다. 다음의 표 1은 이와 같은 테이블 메타데이터의 구체적인 예를 나타낸다. 이러한 테이블 메타데이터는 본 발명을 예시하기 위한 것이며 본 발명이 여기에 한정되는 것은 아니다.In addition, in step S6 of FIG. 3, the primary key or reference key metadata of the table or view is collected. Table 1 below shows specific examples of such table metadata. Such table metadata is intended to illustrate the invention, but the invention is not limited thereto.

도 3의 단계(S7)에서는 컬럼의 이름에 대한 메타데이터를 수집하는 데, 여기서는 데이터베이스에 대하여 Select * from TableName 쿼리를 실행하여 리턴되는 결과에 대한 메타데이터를 검색하여 결과를 얻는다. 다음의 표 2는 이와 같은 컬럼 메타데이터의 구체적인 예를 나타낸다. 이러한 컬럼 메타데이터는 본 발명을 예시하기 위한 것이며 본 발명이 여기에 한정되는 것은 아니다.In step S7 of FIG. 3, metadata about a column name is collected. Here, a select * from TableName query is executed against a database to retrieve metadata about the returned result. Table 2 below shows specific examples of such column metadata. Such column metadata is intended to illustrate the invention but is not limited thereto.

이와 같은 과정을 통하여 각 테이블, 뷰 및 컬럼에 대한 메타데이터 수집을 완료한 후, 템플릿 파일을 로딩하여 프로그램 소스 생성 작업을 행하게 된다. 템플릿 파일은 기설정된 프로그램 소스로 되어 있으며, 생성되는 프로그램 소스에 대한 기본적인 코드들이 구현되어 있고, 치환되어야 할 부분에는 특정 표시가 되어 있다.Through this process, after collecting metadata about each table, view, and column, a template file is loaded to generate a program source. The template file is a predetermined program source, and basic codes for the generated program source are implemented, and the part to be replaced has a specific mark.

다음의 리스트 3은 이와 같은 템플릿 파일의 구체적인 예를 나타낸다. 이와 같은 템플릿 파일은 단지 본 발명을 예시하기 위한 것이며 본 발명이 여기에 한정되는 것은 아니다.Listing 3 below shows a concrete example of such a template file. Such template files are merely illustrative of the present invention and the present invention is not limited thereto.

리스트 3List 3

리스트 3에서 $<....>$ 부분은 수집한 메터데이터와 프로그램소스 생성제어 정보파일의 정보에 따라 치환되는 부분이다. 또한 리스트 3에 예시한 템플릿 파일은 프로그램 개발자가 특정 자바 명령어 코드가 필요한 경우 이를 임의로 추가할 수도 있으므로 상당히 가변적이며, 융통성이 뛰어나다. 이하에서는 리스트 3의 $<...>$에 대하여 설명한다.The $ <....> $ part in Listing 3 is replaced by the collected metadata and the information in the program source control information file. In addition, the template file shown in Listing 3 is quite variable and flexible, as the program developer can optionally add specific Java command code. Hereinafter, $ <...> $ of Listing 3 will be described.

리스트 3의 라인 2, 5 등의 $<CLASSNAME>$는 클래스이름을 치환하는 부분으로 프로그램 소스 생성시 프로그램 소스 제어 정보 및 테이블/뷰의 이름으로 구성된 문자열로 치환되는 부분이다. 또한, 라인 2의 $<GENERATE_DATE>$는 프로그램소스가 생성되는 날짜 및 시간을 치환하는 부분으로 프로그램 실행중에 시스템에서 날짜와 시간을 추출하여 구성된 문자열로 치환되는 부분이다.$ <CLASSNAME> $ in lines 2 and 5 of Listing 3 replaces the class name, which is replaced by a string consisting of program source control information and a table / view name when generating a program source. Also, $ <GENERATE_DATE> $ in line 2 replaces the date and time when the program source is generated and is replaced by a string formed by extracting the date and time from the system during program execution.

그리고 라인 11의 $<PACKAGE_STATEMENT>$는 생성되는 자바 프로그램 소스가 포함될 패키지의 이름이 치환되는 부분으로 프로그램 소스 생성시 프로그램 소스 제어 정보 파일의 정보로 구성된 문자열로 치환되는 부분이다. 라인 25의 $<TABLE_EXPR>$은 관리할 테이블 또는 뷰의 이름이 치환되는 부분으로 프로그램 소스 생성시 데이터베이스의 테이블이름 메타데이터 정보로 구성된 문자열로 치환되는 부분이다.In addition, $ <PACKAGE_STATEMENT> $ in line 11 is replaced with a name of a package to be generated Java program source, which is replaced with a string consisting of information of a program source control information file when generating a program source. $ <TABLE_EXPR> $ in line 25 is replaced with the name of the table or view to be managed. It is replaced with a string consisting of metadata of the table name of the database when the program source is created.

또한, 라인 27의 $<COLUMN_SIZE>$은 관리할 테이블 또는 뷰의 컬럼 개수를 치환하는 부분으로 프로그램 소스 생성시 테이블 메타에이터 정보에서 추출한 문자열로 치환되는 부분이다. 그리고 라인 30의 $<COLUMN_INDEX_ STATEMENTS>$는 각 컬럼에 대해 일련번호를 부여하는 명령어를 치환하는 부분으로 프로그램 소스 생성시 컬럼 메타데이터로부터 추출된 컬럼 이름에 일련번호를 부여하는 명령어 문자열로 치환되는 부분이다.In addition, $ <COLUMN_SIZE> $ in line 27 replaces the number of columns of a table or view to be managed, and is replaced by a string extracted from table metadata information when generating a program source. In addition, $ <COLUMN_INDEX_ STATEMENTS> $ in line 30 replaces a command to give a serial number for each column, and is replaced with a command string to give a serial number to a column name extracted from column metadata when generating a program source. to be.

라인 33의 $<COLUMN_NAME_STATEMENTS>$는 각 컬럼에 대해 컬럼의 이름에 대한 상수를 정의하는 명령어를 치환하는 부분으로, 프로그램 소스 생성시 컬럼 메타데이터로부터 추출된 컬럼 이름에 대해 상수를 정의하는 명령어 문자열로 치환되는 부분이다. 또한 라인 36의 ~$<DEFAULT_ORDER_BY>$~는 생성된 프로그램 소스에서 검색 연산을 수행할 때 결과의 정렬 방법을 정의하는 부분쿼리(Order By 절)를 지정하는 문자열을 치환하는 부분으로 프로그램 소스 생성시 프로그램 소스 제어 정보 파일의 정보로 구성된 문자열로 치환된다.$ <COLUMN_NAME_STATEMENTS> $ in line 33 replaces the command that defines the constant for the column name for each column. The command string defines the constant for the column name extracted from the column metadata when the program source is created. It is a part to be replaced. In addition, ~ $ <DEFAULT_ORDER_BY> $ ~ in line 36 replaces a string specifying a partial query (Order By clause) that defines how to sort the results when performing a search operation on the generated program source. Replaced with a string consisting of the information in the program source control information file.

라인 42의 $<COLUMN_SET_VALUE_STATEMENTS>$는 각 컬럼에 대한 컬럼 클래스를 생성하는 명령어를 치환하는 부분으로, 프로그램 소스 생성시 테이블 메타데이터와 컬럼 메타데이터로부터 추출된 컬럼의 데이터 형식 및 기본키 정보로 구성된 문자열로 치환되는 부분이다. 또한, 라인 49의 $<GET_SET_STATEMENTS>$는 각 컬럼의 값을 Set/Get 메소드로 구현한 부분을 치환하는 부분으로, 프로그램 소스 생성시 컬럼 메타데이터로부터 정의된 컬럼의 일련번호와 자바 명령어로 구성된 문자열로 치환되는 부분이다. 그리고 라인 55의 $<IS_ONLY_QUERY_METHODS>$은 생성되는 프로그램 소스가 검색 쿼리에 관련된 경우 검색 쿼리를 실행하는 명령어가 치환되는 부분으로, 프로그램 소스 생성시 프로그램 소스 제어 정보 파일의 정보로 구성된 문자열로 치환되는 부분이다.$ <COLUMN_SET_VALUE_STATEMENTS> $ in line 42 replaces the command to create a column class for each column. A string consisting of the data type and primary key information of the column extracted from the table metadata and column metadata when the program source is created. Is replaced with. In addition, $ <GET_SET_STATEMENTS> $ in line 49 replaces the implementation of Set / Get method of each column's value, and is a string consisting of the serial number and Java command of the column defined from the column metadata when the program source is generated. Is replaced with. In addition, $ <IS_ONLY_QUERY_METHODS> $ in line 55 is replaced with a command to execute a search query when the generated program source is related to a search query, and is replaced with a string consisting of information of a program source control information file when the program source is generated. to be.

이하에서는 이와 같은 치환 작업이 이루어지며, 메타데이터 수집을 포함하는 프로그램 소스 생성 방법에 대하여 좀더 자세하게 설명한다. In the following, such a substitution operation is performed, and a method of generating a program source including metadata collection will be described in more detail.

도 4a 내지 도 4c는 메타데이터 수집을 포함하는 프로그램 소스 생성 방법을 세부적으로 나타낸 흐름도로서, 데이터베이스내에 있는 모든 테이블에 대한 프로그램 소스를 생성하는 방법을 예시한 도면이다. 도 4a 내지 도 4c의 프로그램 소스 생성 방법은 크게 이름 설정 단계, 메타데이터 수집 단계, 문자열 치환 단계, 및 파일 생성 단계로 이루어져 있다. 이러한 본 발명의 프로그램 생성 과정은 본 발명을 예시하기 위한 것이며, 본 발명이 여기에 한정되는 것은 아니다. 4A through 4C are detailed flowcharts illustrating a method of generating a program source including metadata collection, and illustrating a method of generating a program source for all tables in a database. The program source generating method of FIGS. 4A to 4C is largely composed of a name setting step, a metadata collecting step, a string replacement step, and a file generation step. The program generation process of the present invention is for illustrating the present invention, and the present invention is not limited thereto.

단계(S401)에서 본 발명의 전체적인 과정이 시작된다. 단계(S402)에서 해당 데이터베이스에 접속한다. 다음으로 단계(S403)에서는 데이터베이스에 존재하는 모든 테이블의 이름에 대한 메타 데이터를 수집한다. 단계(S404)에서는 데이터베이스의 접속을 해제한다. 데이터베이스의 접속을 해제한 후, 단계(S405)에서 스크립트 파일의 프로그램 소스 제어 정보로부터 받은 패키지의 이름을 설정한다. 단계(S406)에서 테이블이 더 존재하지 않는 경우 모든 과정을 종료(S407)하며, 테이블이 추가로 존재하는 경우에는 단계(S408)로 진행한다.In step S401, the whole process of the present invention begins. In step S402, the database is accessed. Next, in step S403, metadata about the names of all the tables existing in the database is collected. In step S404, the database is disconnected. After disconnecting the database, in step S405, the name of the package received from the program source control information of the script file is set. If there are no more tables in step S406, the process ends (S407). If the table further exists, the process proceeds to step S408.

수집한 테이블별 이름별로 단계(S409) 내지 단계(S437)의 과정을 반복한다.The process of steps S409 to S437 is repeated for each collected table name.

먼저 단계(S408)에서는 수집한 테이블의 이름을 설정하고, 스크립트 파일의 프로그램 소스 제어 정보로부터 받은 문자열과 테이블 이름으로 클래스 이름을 설정한다 (S409). 다음에는 데이터베이스에 다시 접속하고(S410), 테이블 메타데이터 정보를 수집한다(S411). 예를 들면, 테이블 메타데이터 정보에는 기본키(primary key)가 무엇인지, 기본키중에 다른 테이블에서 참조되는 키가 무엇인지에 대한 정보가 존재한다. 단계(S412)에서는 컬럼 메타데이터 정보를 수집한다. 컬럼 메타데이터 정보에는 예를 들면, 컬럼의 개수, 컬럼의 이름, 컬럼의 데이터형 등이 포함되어 있다. 이와 같이 테이블에 대한 메타데이터 정보수집을 마친 후, 데이터베이스의 접속을 해제한다(S413).First, in step S408, the name of the collected table is set, and the class name is set using the string and the table name received from the program source control information of the script file (S409). Next, access to the database again (S410), and collect the table metadata information (S411). For example, in the table metadata information, there is information about a primary key and a key referenced in another table among the primary keys. In step S412, column metadata information is collected. The column metadata information includes, for example, the number of columns, column names, column data types, and the like. In this way, after collecting metadata information about the table, the database is disconnected (S413).

단계(S414)에서 로딩한 템플릿 파일에 대하여, 먼저 시스템의 현재 시간을 제공받아 템플릿 파일의 생성날짜/시간 부분을 치환한다(S415). 다음으로 도 4b의 단계(S416)에서는 설정된 패키지 이름으로 템플릿 파일의 패키지 이름 부분을 치환하고, 단계(S417)에서는 설정된 클래스 이름으로 템플릿 파일의 클래스 이름 부분을 치환하며, 단계(S418)에서는 설정된 테이블 이름으로 템플릿 파일의 테이블 이름 부분을 치환하고, 단계(S419)에서는 컬럼정보의 컬럼개수로 템플릿 파일의 컬럼 개수 부분을 치환한다.For the template file loaded in step S414, first, the current time of the system is provided to replace the generation date / time part of the template file (S415). Next, in step S416 of FIG. 4B, the package name portion of the template file is replaced by the set package name, in step S417, the class name portion of the template file is replaced by the set class name, and in step S418, the table is set. The table name portion of the template file is replaced by the name, and in step S419, the column number portion of the template file is replaced by the number of columns of the column information.

단계(S420)에서는 컬럼이 더 존재하는 경우 컬럼 개수만큼 반복함으로써 프로그램 소스에서 사용될 컬럼 인덱스 문자열을 생성한다(S421). 여기서, 컬럼 인덱스라고 하는 것은 컬럼에 0부터 일련번호를 부여하는 것을 말한다. 이러한 과정을 거쳐서 단계(S422)에서는 컬럼 인덱스 문자열로 템플릿 파일의 컬럼 인덱스 부분을 치환한다.In step S420, if there are more columns, the column index string to be used in the program source is generated by repeating the number of columns (S421). Here, the column index means assigning a serial number from 0 to a column. Through this process, in step S422, the column index portion of the template file is replaced with the column index string.

단계(S423)에서는 컬럼이 더 존재하는 경우 컬럼 개수만큼 반복함으로써 프로그램 소스에서 사용할 컬럼 변수 문자열을 생성한다(S424). 다음으로 단계(S425)에서 컬럼 변수 문자열로 템플릿 파일의 컬럼 변수 부분을 치환한다. 그 후, 단계(S426)에서 사용자의 입력으로 받은 기본 정렬 방식(default order by) 문자열로 템플릿 파일의 기본 정렬 방식 부분을 치환한다.In step S423, if there are more columns, the column variable string to be used in the program source is generated by repeating the number of columns (S424). Next, in step S425, the column variable portion of the template file is replaced with the column variable string. Thereafter, in step S426, the default sorting method portion of the template file is replaced with a default ordering string received as a user's input.

도 4c의 단계(S427)에서는 컬럼이 더 존재하는 경우 컬럼 개수만큼 반복함으로써 단계(S428)에서 컬럼 클래스를 생성하는 문자열을 생성하고, 단계(S429)에서 컬럼이 기본키인 경우 컬럼에 대해 기본키 정보를 설정하는 문자열을 생성한다. 다음으로 컬럼에 대한 기본키를 설정하고(S430), 테이블 클래스의 컬럼 리스트에 컬럼을 등록하는 문자열을 생성한다(S431).In step S427 of FIG. 4C, if there are more columns, a string for creating a column class is generated by repeating the number of columns in step S428, and in step S429, a primary key for the column when the column is a primary key. Create a string to set the information. Next, the primary key for the column is set (S430), and a string for registering the column in the column list of the table class is generated (S431).

그 다음, 컬럼 정보 설정 메소드 문자열로 템플릿 파일의 컬럼 정보 설정 메소드 부분을 치환한다(S432). 단계(S429)에서 컬럼이 기본키가 아닌 경우에는 바로 단계(S431)의 테이블 클래스의 컬럼 리스트에 컬럼을 등록하는 문자열 생성 단계로 넘어간다.Next, the column information setting method portion of the template file is replaced with the column information setting method string (S432). If the column is not the primary key in step S429, the process proceeds to the string generation step of registering the column in the column list of the table class in step S431.

다음으로 컬럼이 추가로 존재하는 경우에는 단계(S433)에서 컬럼의 개수만큼 반복하여 단계(S434)에서 컬럼별 Get/Set 메소드 문자열을 생성한다. 그 후 컬럼 Get/Set 메소드 문자열로 단계(S435)에서 템플릿 파일의 컬럼별 Get/Set 메소드 부분을 치환하며, 단계(S436)에서 클래스 이름으로 생성될 파일이름을 설정한다. 단계(S437)에서는 치환된 템플릿 파일을 프로그램 소스 파일에 출력한다. 이러한 과정을 거쳐 본 발명의 프로그램 소스를 생성할 수 있다.Next, in the case where additional columns exist, in step S433, the number of columns is repeated to generate a get / set method string for each column in step S434. Subsequently, in step S435, the Get / Set method for each column of the template file is replaced with the column Get / Set method string, and in step S436, a file name to be generated as a class name is set. In step S437, the substituted template file is output to the program source file. Through this process, the program source of the present invention can be generated.

이처럼 기본 연산을 수행하는 것 이외에 본 발명은 전술한 마이그레이션을 실행하는 프로그램 소스를 부가적으로 생성한다. 본 발명은 이와 같은 마이그레이션용 프로그램 소스 생성 방법을 제공하는 데, 여기서는 전술한 기본 연산용 프로그램 소스에다가 매핑(mapping) 기능을 부가함으로써 응용 프로그램의 일종인 마이그레이션용 프로그램 소스 생성 방법을 제공한다.In addition to performing the basic operation as described above, the present invention additionally generates a program source for executing the above-described migration. The present invention provides a migration program source generation method as described above, and provides a migration program source generation method which is a kind of application program by adding a mapping function to the above-described basic operation program source.

도 5는 본 발명에 있어서 마이그레이션 작업을 실행할 수 있는 프로그램 소스 생성 순서를 나타내는 흐름도이다.5 is a flowchart illustrating a program source generation procedure capable of executing a migration task in the present invention.

단계(S51)에서는 프로그램 개발자가 마이그레이션용 스크립트 파일을 작성한다. 특히 사용자 정의 함수가 필요한 경우, 프로그램 개발자는 사용자 정의함수를 구현한다. 사용자 정의 함수라 함은 마이그레이션 과정 중 프로그램 개발자의 논리적인 정제 과정을 기능화하여 구현한 것을 말한다. In step S51, the program developer creates a script file for migration. Especially when user-defined functions are needed, program developers implement them. The user defined function is a functional implementation of the program developer's logical refinement process during the migration process.

예를 들면, 소스 데이터베이스 중 하나의 테이블의 2개 이상의 컬럼이, 목적 데이터베이스 중 하나의 테이블의 하나의 컬럼으로 옮겨져야 할 경우, 프로그램 개발자가 2개 이상의 컬럼이 하나로 합쳐지는 방법에 대하여 지정할 필요가 있는데, 이 경우 프로그램 개발자가 어떤 방법으로 합치라고 지정할 수 있고 이를 함수로 구현한다.For example, if two or more columns of one table in a source database need to be moved to one column of one of the tables in a target database, the program developer needs to specify how two or more columns are merged into one. In this case, the program developer can specify in some way the match and implement it as a function.

사용자 정의 함수의 또다른 예로서, '1'은 '가'로, '2'는 '나'로 등과 같이 하나의 컬럼 값이 목적 데이터베이스로 옮겨가면서 값이 변경되어야 하는 경우가 있다. 이러한 경우 프로그램 개발자는 변경되는 내용을 함수로 제공해야 한다.As another example of a user-defined function, there is a case where one column value needs to change as one column value is moved to the target database, such as '1' to 'a' and '2' to 'I'. In such a case, the program developer must provide the change as a function.

이어서 단계(S52)에서는 프로그램 개발자가 마이그레이션용 스크립트 파일을 입력하여 소스 생성 프로그램을 구동하고, 소스 생성 프로그램은 스크립트 파일을 분석한다(S53). 그 후 단계(S54) 및 단계(S55)에서 각각 소스 데이터베이스 및 목적 데이터베이스의 프로그램 소스를 생성한다. 다음으로 이러한 소스 데이터베이스 및 목적 데이터베이스의 프로그램 소스를 연결할 매핑 기능 프로그램 소스를 생성한다(S56).Subsequently, in step S52, a program developer inputs a script file for migration to drive a source generation program, and the source generation program analyzes the script file (S53). Thereafter, in step S54 and step S55, program sources of the source database and the target database are generated, respectively. Next, a mapping function program source to connect the program source of the source database and the target database is generated (S56).

매핑 기능은 소스 데이터베이스의 어떤 테이블에 있는 어떤 컬럼 데이터를 목적지 데이터베이스의 어떤 테이블의 어떤 컬럼으로 옮길지를 정의한 부분을 읽어서 정의한 대로 데이터를 옮기는 기능을 말한다. 매핑 방법에는 2가지가 있는데, 하나는 1:N 매핑으로서 소스 데이터베이스 중 하나의 테이블을 지정하고, 목적 데이터베이스 중 하나 이상의 테이블을 지정하여 마이그레이션하는 경우를 말하며, 다른 하나는 쿼리 매핑으로서, 소스 데이터베이스에서 검색 쿼리를 실행하여 나오는 결과를 목적 데이터베이스 중 하나 이상의 테이블로 마이그레이션하는 경우를 말한다.The mapping function is to move data as defined by reading the part defining which column data in a table of the source database is moved to which column of a table of the destination database. There are two mapping methods, one of which is a 1: N mapping, in which one table of the source database is specified and one or more tables in the destination database are designated and migrated. The other is a query mapping. When a result of executing a search query is migrated to one or more tables in the target database.

마이그레이션 작업을 위하여 스크립트 파일에 지정해야 하는 정보를 다음의 표 3에 나타낸다.Table 3 shows the information that must be specified in the script file for the migration.

다음의 리스트 4는 이와 같은 본 발명의 마이그레이션용 프로그램 소스를 코딩한 것을 예시적으로 나타낸다. 이와 같은 프로그램 소스는 본 발명을 예시하기 위한 것이며, 본 발명이 여기에 한정되는 것은 아니다.Listing 4 below shows an example of coding such a migration program source of the present invention. Such a program source is for illustrating the present invention, and the present invention is not limited thereto.

리스트 4List 4

리스트 4는 전술한 바와 같은 기본 연산용 프로그램 소스를 바탕으로 하여 생성된 소스 데이터베이스 및 목적 데이터베이스를 기반으로 하여 매핑 과정을 통하여 마이그레이션용 프로그램 소스를 생성하는 과정을 예시하고 있다.Listing 4 exemplifies a process of generating a migration program source through a mapping process based on a source database and a target database generated based on the basic operation program source as described above.

먼저 리스트 4의 라인 19 내지 라인 22에서는 소스 데이터베이스에 대한 정보가 코딩되어 있다. 소스 데이터베이스에 대해서는, 먼저 소스 데이터베이스에 접속할 때 사용하는 JDBC 드라이버를 지정하고(라인19), 소스 데이터베이스에 접속할 때 사용하는 JDBC URL을 지정하며(라인20 ), 소스 데이터베이스에 접속할 때 사용하는 사용자 ID(라인21) 및 소스 데이터베이스에 접속할 때 사용하는 사용자 비밀번호(라인22)를 지정한다.First, information about the source database is coded in lines 19 to 22 of Listing 4. For the source database, first specify the JDBC driver to use to connect to the source database (line 19), specify the JDBC URL to use to connect to the source database (line 20), and the user ID to use to connect to the source database (line 20). Line 21) and the user password (line 22) used to connect to the source database.

이러한 소스 데이터베이스를 목적 데이터베이스로 옮겨야 하므로, 다음에는 목적 데이터베이스에 대하여 코딩한다. 먼저 목적 데이터베이스에 접속할 때 사용하는 JDBC 드라이버를 지정하고(라인32), 목적 데이터베이스에 접속할 때 사용하는 JDBC URL을 지정하며(라인33), 목적 데이터베이스에 접속할 때 사용하는 사용자 ID(라인34) 및 목적 데이터베이스에 접속할 때 사용하는 사용자 비밀번호(라인35)를 코딩한다.Since we need to move these source databases to the target database, we will code for the target database next. First, specify the JDBC driver used to connect to the target database (line 32), specify the JDBC URL used to connect to the target database (line 33), and the user ID (line 34) and destination used to connect to the target database. Code the user password (line 35) used to connect to the database.

이러한 목적 데이터베이스 및 소스 데이터베이스에 대한 설정이 완료되면 1:N 매핑 또는 쿼리 매핑을 실행함으로써 데이터베이스에 대한 마이그레이션 작업을 완료한다.Once the configuration for these destination and source databases is complete, complete the migration for the database by running 1: N mapping or query mapping.

먼저 1:N 매핑을 하는 경우에는 소스 테이블 이름(라인59), 목적 테이블 이름(라인60, 61)을 코딩하고, 라인63 내지 70의 등호(=) 좌측에는 목적테이블(SNMPDATAEQUIP)의 컬럼명, 우측에는 소스테이블의 컬럼명을 코딩한다. 또한, 라인71 내지 77의 등호(=) 좌측에는 목적테이블(SNMPPOOLEQUIP)의 컬럼명, 우측에는 소스테이블의 컬럼명을 코딩하며, 매핑할 때 사용자정의함수 snmpver() 를 정의한다(라인70).First, in case of 1: N mapping, the source table name (line 59) and the target table name (line 60, 61) are coded.On the left side of the equal sign (=) in lines 63 to 70, the column name of the object table (SNMPDATAEQUIP) On the right side, the column name of the source table is coded. In addition, the column names of the object table SNMPPOOLEQUIP are coded on the left side of the equal sign (=) in lines 71 to 77, and the column names of the source table on the right side, and a user-defined function snmpver () is defined when mapping (line 70).

쿼리 매핑인 경우에는 소스 데이터베이스에서의 검색 쿼리(라인101, 102) 및 목적 테이블 이름(라인104)을 코딩하고, 라인106, 107의 등호(=) 좌측은 목적테이블(SNMPDATAEQUIP)의 컬럼명, 우측은 소스 데이터베이스의 검색 쿼리 컬럼명을 코딩한다.In the case of query mapping, the search query from the source database (lines 101 and 102) and the target table name (line 104) are coded. Codes the name of the search query column in the source database.

이러한 과정을 통하여 마이그레이션용 프로그램 소스를 생성할 수 있다.Through this process, program source for migration can be created.

이상에서 설명한 바와 같이, 본 발명에서는 데이터베이스의 테이블 및 뷰에 따라 하나의 클래스 소스를 생성하고 이 클래스를 이용하여 데이터베이스 연산을 할 수 있는 환경을 제공함으로써 데이터베이스를 이용하는 시스템 개발자에게 시스템 개발 기간을 단축시켜 주며, 프로그램의 오류를 줄일 수 있다는 이점이 있다As described above, in the present invention, by creating a class source according to a table and a view of a database and providing an environment in which a database operation can be performed using this class, a system development period is shortened to a system developer using a database. It has the advantage of reducing the error of the program.

이로써 프로그램 개발자는 손쉽게 데이터베이스의 데이터 연산용 프로그램 소스를 개발할 수 있으므로, 단순 작업을 행하던 종래에 비해 프로그램 소스 생성에 필요한 시간 및 비용을 상당히 줄일 수 있다.As a result, a program developer can easily develop a program source for data operation of a database, thereby significantly reducing the time and cost required to generate a program source, compared with the conventional simple work.

그리고 본 발명에서는 데이터베이스의 스키마가 변경되었을 경우 관련된 프로그램의 소스를 모두 변경하던 방법을 탈피하여, 데이터베이스의 스키마가 변경되었을 경우 변경이 필요한 부분에 대해 자동으로 변경된 내용의 소스를 생성해 줌으로써 프로그램 개발자의 프로그램 개발 기간을 단축하고 오류를 완전히 제거할 수 있다.In addition, in the present invention, when the schema of the database is changed, the method of changing the source of all related programs is avoided, and when the schema of the database is changed, the source of the changed contents is automatically generated by generating the source of the changed contents. Shorten program development time and eliminate errors completely.

또한 본 발명에서는 부가적으로 마이그레이션 프로그램 소스 생성 방법을 통하여 생성된 마이그레이션 프로그램 소스를 제공하므로, 프로그램 개발자는 마이그레이션에 대한 추가적인 개발 작업없이 생성된 프로그램 소스를 컴파일하여 바로 사용할 수 있다는 이점이 있다. In addition, the present invention additionally provides a migration program source generated through the migration program source generation method, so that a program developer can compile and use the generated program source immediately without additional development work for migration.

본 발명을 앞서 기재한 바에 따라 설명하였지만, 다음에 기재하는 특허청구범위의 개념과 범위를 벗어나지 않는 한, 다양한 수정 및 변형이 가능하다는 것을 본 발명이 속하는 기술 분야에 종사하는 자들은 쉽게 이해할 것이다.Although the present invention has been described above, it will be readily understood by those skilled in the art that various modifications and variations are possible without departing from the spirit and scope of the claims set out below.

도 1은 본 발명의 전체적인 개념을 나타낸 개략적인 도면이다.1 is a schematic diagram showing the overall concept of the present invention.

도 2는 본 발명의 프로그램 소스 생성 장치를 나타내는 블록도이다.2 is a block diagram showing a program source generating apparatus of the present invention.

도 3은 본 발명의 프로그램 소스 생성 방법을 나타내는 전체적인 흐름도이다.3 is an overall flowchart illustrating a method of generating a program source of the present invention.

도 4a 내지 도 4c는 본 발명의 프로그램 소스 생성 방법을 세부화한 흐름도이다.4A to 4C are flowcharts detailing the method of generating a program source of the present invention.

도 5는 마이그레이션(migration) 작업을 실행하는 본 발명의 프로그램 소스 생성 순서를 나타내는 흐름도이다.5 is a flowchart showing a program source generation procedure of the present invention for executing a migration task.

도 6은 사용자의 요구에 따른 데이터베이스의 연산 실행 과정을 개략적으로 나타낸 도면이다.6 is a diagram schematically illustrating a process of executing an operation of a database according to a user's request.

<도면의 주요부분에 대한 부호의 설명><Description of the symbols for the main parts of the drawings>

1. 프로그램 소스 생성기 2. 데이터베이스1. Program source generator 2. Database

3. 스크립트 파일 4. 템플릿 파일 3. Script file 4. Template file

5. 소스 파일 6. 프로그램 개발자5. Source File 6. Program Developer

7. 사용자 22. CPU(central processing unit)7. User 22. Central processing unit (CPU)

23. 메모리 24. 데이터저장유닛23. Memory 24. Data storage unit

241. 데이터베이스 접속정보파일 242. 프로그램소스 생성정보파일241. Database connection information file 242. Program source creation information file

243. 템플릿(template) 파일 244. 라이브러리 파일243. template file 244. library file

245. 생성된 프로그램소스파일245. Generated program source file

Claims (9)

데이터베이스에 대한 연산을 수행하는 프로그램 소스 생성 장치로서,A program source generating device that performs an operation on a database, 프로그램 소스 생성에 필요한 파일을 저장하는 데이터저장유닛 및A data storage unit for storing files necessary for generating a program source; 상기 데이터저장유닛의 상기 파일들에 대한 명령을 수행하는 CPU(central processing unit)를 포함하며,A central processing unit (CPU) that executes instructions for the files of the data storage unit, 상기 데이터저장유닛은,The data storage unit, 상기 데이터베이스에 대한 접속 정보를 저장하는 데이터베이스 접속정보파일,A database access information file for storing access information for the database; 상기 프로그램 소스 생성에 필요한 정보를 저장하는 프로그램 소스 생성정보파일,A program source generation information file for storing information necessary for generating the program source; 기설정된 프로그램 소스를 저장하고, 상기 기설정된 프로그램 소스를 바탕으로 하여 상기 프로그램 소스 생성에 필요한 정보에 따라 상기 프로그램을 생성하기 위한 템플릿(template) 파일,A template file for storing a predetermined program source and generating the program according to information necessary for generating the program source based on the preset program source, 상기 메타데이터를 수집하고, 상기 프로그램 소스 생성에 적용되는 라이브러리를 포함하는 라이브러리 파일 및A library file that collects the metadata and includes a library applied to the program source generation; 상기 프로그램소스 생성정보파일에 저장된 프로그램소스 생성정보에 따라 상기 템플릿 파일 중 하나 이상의 변수값을 상기 메타데이터에 관한 문자열로 치환함으로써 생성된 프로그램 소스파일A program source file generated by replacing one or more variable values of the template file with a string related to the metadata according to the program source generation information stored in the program source generation information file 을 포함하는 프로그램 소스 생성 장치. Program source generating device comprising a. 제1항에서,In claim 1, 상기 데이터저장유닛은 상기 생성된 프로그램 소스에 따라 마이그레이션 (migration)을 실행하기 위한 마이그레이션용 정보 파일을 더 포함하는 프로그램 소스 생성 장치.And the data storage unit further comprises a migration information file for executing migration according to the generated program source. 데이터베이스에 대한 연산을 수행하는 프로그램 소스 생성 방법으로서,Program source generation method that performs operations on a database. 프로그램 소스 생성기가 상기 데이터베이스의 접속 정보를 가져오는 단계,A program source generator fetching access information of the database, 상기 프로그램 소스 생성기가 상기 데이터베이스에 대한 프로그램 소스 생성에 필요한 프로그램 소스 생성 정보를 가져오는 단계,Obtaining, by the program source generator, program source generation information necessary for generating a program source for the database; 상기 프로그램 소스 생성기가 상기 데이터베이스의 메타데이터를 수집하는 단계,Collecting metadata of the database by the program source generator; 상기 프로그램 소스 생성기가 상기 프로그램 소스 생성에 필요한 기설정된 프로그램 소스를 포함하는 템플릿 파일을 로딩하는 단계 및Loading, by the program source generator, a template file including a preset program source required for generating the program source; 상기 프로그램 소스 생성기가 상기 프로그램 소스 생성 정보에 따라 상기 템플릿 파일의 상기 기설정된 프로그램 소스 중 하나 이상의 변수값을 상기 메타데이터에 관한 문자열로 치환하여 프로그램 소스를 생성하는 단계Generating, by the program source generator, a program source by replacing one or more variable values of the preset program sources of the template file with a string related to the metadata according to the program source generation information; 를 포함하는 프로그램 소스 생성 방법.Program source generation method comprising a. 제3항에서,In claim 3, 상기 프로그램 소스 생성기가 상기 데이터베이스의 접속 정보를 가져오는 단계는, 접속시에 사용하는 드라이버(driver), URL(uniform resource locator), 사용자 ID, 사용자 패스워드, 초기설정 데이터베이스 접속개수, 최대설정 데이터베이스 접속개수, 그리고 타임아웃(timeout) 발생 최대시간을 포함하고, 스크립트(script) 파일 형태로 저장되어 있는 데이터베이스 접속 정보 파일을 로딩하여 데이터베이스 접속 정보를 추출하는 프로그램 소스 생성 방법.The step of obtaining the connection information of the database by the program source generator may include a driver, a uniform resource locator (URL), a user ID, a user password, an initial database connection number, and a maximum database connection number. And extracting the database connection information by loading the database connection information file stored in the form of a script file, including a maximum timeout occurrence time. 제3항에서, In claim 3, 상기 프로그램 소스 생성기가 상기 프로그램 소스 생성 정보를 가져오는 단계는, 소스 생성 대상의 범위 및 종류, 패키지 이름, 클래스 이름, 결과의 정렬, 그리고 쿼리의 구조에 관한 정보를 포함하며, 스크립트 파일 형태로 저장되어 있는 프로그램 소스 생성 정보 파일을 로딩하여 프로그램 소스 생성 정보를 추출하는 프로그램 소스 생성 방법.The step of obtaining the program source generation information by the program source generator includes information on the range and type of the source generation target, the package name, the class name, the sorting of the results, and the structure of the query, which are stored in the form of a script file. Program source generation method for extracting the program source generation information by loading the program source generation information file. 제3항에서,In claim 3, 상기 프로그램 소스 생성기가 상기 메타데이터를 수집하는 단계는, 상기 데이터베이스의 메타데이터, 테이블 메타데이터 및 컬럼 메타데이터를 수집하고, 상기 데이터베이스에서 상기 메타데이터를 수집하여 프로그램 소스 생성 정보를 추출하는 프로그램 소스 생성 방법.The collecting of the metadata by the program source generator may include collecting metadata, table metadata, and column metadata of the database, and extracting program source generation information by collecting the metadata from the database. Way. 제3항에서,In claim 3, 상기 프로그램 소스 생성 방법을 마이그레이션용 프로그램 소스 생성에 사용하는 프로그램 소스 생성 방법.Program source generation method using the program source generation method for generating a program source for migration. 제3항 내지 제7항 중 어느 한 항에 따른 방법을 수행하기 위한 일련의 명령을 포함하는 컴퓨터 프로그램 제품.A computer program product comprising a series of instructions for performing a method according to any one of claims 3 to 7. 제8항에서,In claim 8, 상기 일련의 명령에 포함되는 명령어를 제공하는 라이브러리를 추가로 포함하는 컴퓨터 프로그램 제품.And a library for providing instructions included in the series of instructions.
KR10-2002-0060345A 2002-10-02 2002-10-02 The apparatus and method of creating program source for operating database and the computer program product using the same KR100505111B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0060345A KR100505111B1 (en) 2002-10-02 2002-10-02 The apparatus and method of creating program source for operating database and the computer program product using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0060345A KR100505111B1 (en) 2002-10-02 2002-10-02 The apparatus and method of creating program source for operating database and the computer program product using the same

Publications (2)

Publication Number Publication Date
KR20040029898A KR20040029898A (en) 2004-04-08
KR100505111B1 true KR100505111B1 (en) 2005-07-29

Family

ID=37331241

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0060345A KR100505111B1 (en) 2002-10-02 2002-10-02 The apparatus and method of creating program source for operating database and the computer program product using the same

Country Status (1)

Country Link
KR (1) KR100505111B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100737522B1 (en) * 2005-12-02 2007-07-10 한국전자통신연구원 Method and system for monitoring migration data
KR101470427B1 (en) * 2007-12-27 2014-12-08 주식회사 케이티 Method and system for migration using version information of database
KR101020234B1 (en) * 2009-01-16 2011-03-08 정해영 Method of creating application program source for database and device thereof

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10187512A (en) * 1996-12-27 1998-07-21 Hitachi Ltd Method for generating program for database structuring and database operation
JPH11120047A (en) * 1997-10-17 1999-04-30 Hitachi Ltd Db table generation system for html form
KR19990040514A (en) * 1997-11-18 1999-06-05 정선종 How to create CGI program automatically
KR20000015619A (en) * 1998-08-31 2000-03-15 정선종 Apparatus and method for generating a web document automatically
KR20000046055A (en) * 1998-12-31 2000-07-25 윤종용 Device and method for creation of communication system's database
KR20020022854A (en) * 2000-09-21 2002-03-28 박병형 Method for Creating Program Code Automatically Using Pattern and Component
KR20020028001A (en) * 2000-10-06 2002-04-15 신훈 treat system of food sweepings in apartment
KR20020083090A (en) * 2001-04-26 2002-11-01 (주) 디엠디 Generating Method of pages related database and executed in the server

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10187512A (en) * 1996-12-27 1998-07-21 Hitachi Ltd Method for generating program for database structuring and database operation
JPH11120047A (en) * 1997-10-17 1999-04-30 Hitachi Ltd Db table generation system for html form
KR19990040514A (en) * 1997-11-18 1999-06-05 정선종 How to create CGI program automatically
KR20000015619A (en) * 1998-08-31 2000-03-15 정선종 Apparatus and method for generating a web document automatically
KR20000046055A (en) * 1998-12-31 2000-07-25 윤종용 Device and method for creation of communication system's database
KR20020022854A (en) * 2000-09-21 2002-03-28 박병형 Method for Creating Program Code Automatically Using Pattern and Component
KR20020028001A (en) * 2000-10-06 2002-04-15 신훈 treat system of food sweepings in apartment
KR20020083090A (en) * 2001-04-26 2002-11-01 (주) 디엠디 Generating Method of pages related database and executed in the server

Also Published As

Publication number Publication date
KR20040029898A (en) 2004-04-08

Similar Documents

Publication Publication Date Title
US5898872A (en) Software reconfiguration engine
US6243709B1 (en) Method and apparatus for loading stored procedures in a database corresponding to object-oriented data dependencies
EP0664027B1 (en) Program modeling system
US6279008B1 (en) Integrated graphical user interface method and apparatus for mapping between objects and databases
US5819282A (en) Database generator
US6374256B1 (en) Method and apparatus for creating indexes in a relational database corresponding to classes in an object-oriented application
EP0693193B1 (en) Incremental linker system
US7814459B2 (en) System and method for automated on demand replication setup
WO1999000745A1 (en) Data repository with user accessible and modifiable reuse criteria
WO2007070631A2 (en) Apparatus and method for creating portable etl jobs
CN109710220B (en) Relational database query method, relational database query device, relational database query equipment and storage medium
US20210209098A1 (en) Converting database language statements between dialects
US20080201290A1 (en) Computer-implemented methods, systems, and computer program products for enhanced batch mode processing of a relational database
US7707211B2 (en) Information management system and method
US20060218174A1 (en) Method for coordinating schema and data access objects
KR100505111B1 (en) The apparatus and method of creating program source for operating database and the computer program product using the same
US8630981B1 (en) Techniques for differencing binary installation packages
WO1999033004A1 (en) An integrated graphical user interface method and apparatus for mapping between objects and databases
EP1040432B1 (en) Method and apparatus for loading stored procedures in a database corresponding to object-oriented data dependencies
US20240134833A1 (en) Relational database system
Huber From Sierra to FOLIO: Cataloging perspectives on migration and post-implementation impact
CN115495442A (en) Database operation file generation method, device, equipment and storage medium
RU2534823C1 (en) Method of generating syntactically and semantically correct commands
CN115658726A (en) Database integration method, device, equipment and storage medium
CN113626423A (en) Log management method, device and system of service database

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20121019

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20130722

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee