Skip to content

Developer Guide Kor

Cho HyunJong edited this page Jan 20, 2014 · 18 revisions

Tadpole DB HUB ๊ฐœ๋ฐœ์ž ๊ฐ€์ด๋“œ

  • ์ž‘์„ฑ์ผ : 2013.08.04
  • ์ž‘์„ฑ์ž : Cho HyunJong([email protected])

์˜ฌ์ฑ™์ด๋Š” ์›น ๊ธฐ๋ฐ˜ DB ๊ด€๋ฆฌ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ์˜ฌ์ฑ™์ด๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ DB๋กœ ์ ‘์†ํ•  ์ˆ˜ ์žˆ๊ณ , ๊ถŒํ•œ์„ ์กฐ์ ˆ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ฌ์ฑ™์ด์˜ ์ตœ์ข… ์ง€ํ–ฅ์€ DB HUB ์ž…๋‹ˆ๋‹ค.

  • ํ™ˆํŽ˜์ด์ง€ : https://github.com/hangum/TadpoleForDBTools/wiki
  • ์˜ฌ์ฑ™์ด๋Š” LGPL๋ผ์ธ์„ ์Šค๋กœ ์‚ฌ์šฉ์ด ํ—ˆ๋ฝ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๊ธฐ๋ถ€๋Š” Paypal๋กœ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ถ€๋ฐฉ๋ฒ• ๋ฐ ๊ธฐ๋ถ€์ž๋Š” ๋‹ค์Œ์„ ์ฐธ์กฐ ํ•˜์„ธ์š”.
  • ์˜ฌ์ฑ™์ด์— ๊ด€๋ จ๋ฌธ์˜ : TADPOLE([email protected])

๋ชฉ์ฐจ

์˜ฌ์ฑ™์ด์— ์‚ฌ์šฉ ๋œ ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

  1. Eclipse RAP & GEF Port, EMF, OrionHub, FileUpload etc
  2. Amazon AWS java SDK(http://aws.amazon.com/en/sdkforjava/)
  3. Java Simplified Encryption(http://www.jasypt.org/)
  4. Apache Hadoop, DBCP, iBatis, Commons, HttpComponents-client, log4j, slf4j.. etc
  5. Java Excel API(http://jexcelapi.sourceforge.net/)
  6. JSqlParser(https://github.com/JSQLParser/JSqlParser)
  7. SQLFormatter(?)
  8. Gson(https://code.google.com/p/google-gson/)
  9. Cubrid JDBC Driver
  10. Apache Hive JDBC Driver
  11. MariaDB JDBC Driver
  12. MongoDB JDBC Driver
  13. MSSQL JDBC Driver(jtds, http://jtds.sourceforge.net/)
  14. MySQL JDBC Driver
  15. Oracle JDBC Driver
  16. PostgreSQL JDBC Driver
  17. SQLite JDBC Driver

๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์†Œ์Šค ๋‚ด๋ ค ๋ฐ›๊ธฐ.

  1. ๊ฐœ๋ฐœ ํˆด์€ 4.3 Kepler ๋ฒ„์ „ Eclipse RCP and RAP Developers๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  2. ์†Œ์Šค๋Š” github์˜ ๋‹ค์Œ(https://github.com/hangum/TadpoleForDBTools/) ์œ„์น˜์— ์กด์žฌ ํ•ฉ๋‹ˆ๋‹ค.
  3. ์ดํด๋ฆฝ์Šค ์›Œํฌ์ŠคํŽ˜์ด์Šค encoding ํƒ€์ž…์„ UTF-8๋กœ ์ˆ˜์ •ํ•˜์„ธ์š”.(Window -> Preference -> General -> Workspace -> UTF-8)
  4. Master Branch ์†Œ์Šค๋ฅผ ๋กœ์ปฌ์— ๋‚ด๋ ค ๋ฐ›์œผ์„ธ์š”.

ํ˜„์žฌ ์‚ฌ์šฉํ•˜๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ EGit, Log4E, WindowBuilder, Subclipse, ResourceBundle Editor 0.8.0 ๋“ฑ์ž…๋‹ˆ๋‹ค.

Target Platform ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  1. Git ํ™ˆ์„ ์ดํด๋ฆฝ์Šค ๋ณ€์ˆ˜๋กœ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค. Window -> Preference -> Run/Debug -> String Substitution ์— git-tadpole ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•˜๊ณ  git-home์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ €๋Š” C:\dev\eclipse-SDK-4.3\eclipse\workspace-tadpole\TadpoleDBHub ๋กœ ์„ค์ • ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  2. ์˜ฌ์ฑ™์ด ํƒ€๊ฒŸ ํŒŒ์ผ์€ ${workspace}/targetProject/tadpolea-rap-2.0.0-emf-standalone.target์„ ์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ํŒŒ์ผ์„ ๋”๋ธ” ํด๋ฆญํ•˜์‹ญ์‹œ์˜ค. ์˜ค๋ฅธ์ชฝ ์ƒ๋‹น Set as Target Platform์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  3. API Baselines์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Window -> Preference -> Plug-in Development -> API Baselines๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
    Add Baseline..์„ ํด๋ฆญํ•œ ํ›„ ์ ๋‹นํ•œ ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜๊ณ  Reset์„ ๋ˆ„๋ฅด๊ณ  Finish์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  4. Project -> Clean.. ์„ ๋ˆŒ๋Ÿฌ ์ „์ฒด ์ปดํŒŒ์ผ ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ ๊นŒ์ง€ํ•˜๋ฉด ์˜ฌ์ฑ™์ด ํ”„๋กœ์ ํŠธ์— ์—๋Ÿฌ๊ฐ€ ์—†์–ด์•ผ ๋งž์Šต๋‹ˆ๋‹ค.

target platform

์‹คํ–‰

๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•

  1. com.hangum.tadpole.application.start ํ”„๋กœ์ ํŠธ์˜ TadpoleDBHub_executer_configuration.launch ๋ฅผ ํด๋ฆญ ํ•˜์„ธ์š”. ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๊ณ  Run As -> TadpoleDBHub_executer_configuration ๋ฅผ ํด๋ฆญํ•˜์‹œ๋ฉด ์˜ฌ์ฑ™์ด๊ฐ€ ์‹œ์ž‘ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๋ณต์žกํ•œ ๋ฐฉ๋ฒ•

  1. com.hangum.tadpole.application ํ”„๋กœ์ ํŠธ์˜ plugin.xml ํŒŒ์ผ์„ ๋”๋ธ”ํด๋ฆญํ•˜์—ฌ ํ•ฉ๋‹ˆ๋‹ค. Launch a RAP Application ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์ฒ˜์Œ์‹คํ–‰์‹œ ๋Œ€๋ถ€๋ถ„ ์‹คํŒจํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
  2. ์ดํด๋ฆฝ์Šค ์•ˆ์—์„œ์˜ ์‹คํ–‰ ํ™˜๊ฒฝ์„ ์„ค์ •ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๋ฉ”๋‰ด -> Run -> Debug Configuration ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. ๋‹ค์ด์–ผ๋กœ๊ทธ ํ™”๋ฉด์ด ์˜คํ”ˆ๋˜๋Š”๋ฐ, RAP Application์ด๋ฆ„์œผ๋กœ ์‹คํ–‰๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค. Main ํ…์—์„œ Servlet path ์—๋Š” /tadpole๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. eclipse launch
  4. Bundle ํ…์—์„œ Deselect All์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์‹œ com.hangum.tadpole.application.start, org.eclipse.equinox.http.jetty, org.eclipse.equinox.console, org.apache.felix.gogo.shell์˜ ์ฑ„ํฌ ๋ฐ•์Šค๋ฅผ ํด๋ฆญํ•ด ์ค๋‹ˆ๋‹ค. ๊ทธ ํ›„์— Add Required Bundle๋ฒˆํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  5. ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์˜คํ”ˆ๋˜๊ณ  404 not found๊ฐ€ ๋‚˜์˜ฌํ…๋ฐ ๋ฆฌํ”„๋ ˆ์‰ฌ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์„œ ํŽ˜์ด์ง€๊ฐ€ ์ •์ƒ ์˜คํ”ˆ๋˜๋Š”๊ฒƒ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  6. ์ข€๋” ํŽธํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” Debug Configuration์˜ RAP Application์—์„œ Argument tab์—์„œ Program Argumentํ•ญ๋ชฉ ์ œ์ผ ๋’ค์— -test -debuglog๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. -test์˜ ์˜ต์…˜์€ ํ…Œ์ŠคํŠธ ํ™˜๊ฒฝ์„ ๋™์ž‘ํ•˜๋ผ, -debuglog๋Š” ๋กœ๊ทธ ์˜ต์…˜์„ deblog๋กœ ํ•˜๋ผ๋Š” ๋ง์ž…๋‹ˆ๋‹ค.

์ด ๋น„๋””์˜ค๋ฅผ ๋ณด์„ธ์š”. http://www.youtube.com/watch?v=qTL24cQ6ISc

ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค๋ช…

  • com.hangum.tadpole.application.start : ํ”„๋กœ์ ํŠธ ์‹œ์ž‘๊ณผ ์ข…๋ฃŒ ๋ถ€๋ถ„
  • com.hangum.tadpole.rdb.core : Database ๋ฆฌ์ŠคํŠธ์™€ Table, Column ๋ฆฌ์ŠคํŠธ ํ™”๋ฉด ๋ฐ RDB ๋ฉ”์ธ ์—๋””ํ„ฐ ์ฐฝ ๋ถ€๋ถ„
  • com.hangum.tadpole.application : ํผ์ŠคํŒฉํ‹ฐ๋ธŒ ์„ค์ • ๋ฐ ๋กœ๊ทธ์ธ ํ™”๋ฉด ๋ถ€๋ถ„
  • com.hangum.tadpole.commons.libs : ๊ณตํ†ต ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ •์˜
  • com.hangum.tadpole.commons.sql : SQL๊ด€๋ จ ๊ณตํ†ต ์ฝ”๋“œ ์ •์˜(์—”์ง„๊ณผ ์—…๋ถ€ ๊ณตํ†ต)
  • com.hangum.tadpole.commons.sql.test : com.hangum.db.commons.sql ๊ด€๋ จ ํ…Œ์ŠคํŠธ ํ”Œ๋Ÿฌ๊ทธ์ธ
  • com.hangum.tadpole.commons : ๊ณตํ†ต ์ฝ”๋“œ ์œ ํ‹ธ
  • com.hangum.tadpole.editor.core : Editor ๊ด€๋ จ ๊ณตํ†ต ์ฝ”๋“œ ์ •์˜
  • com.hangum.tadpole.sql.parser : SQL Parser, Formatter ๊ด€๋ จ ์ฝ”๋“œ
  • com.hangum.tadpole.build.war : WAR๋กœ ๋ฐฐํฌํ•˜๊ธฐ์œ„ํ•œ ํ”Œ๋Ÿฌ๊ทธ์ธ
  • com.hangum.tadpole.rdb.model : RDB ๋ชจ๋ธ ์ •์˜(ํ˜„์žฌ๋Š” ERD ํ”„๋กœ์ ํŠธ์—์„œ๋งŒ ์‚ฌ์šฉ)
  • com.hangum.tadpole.rdb.erd.core : RDB ERD ๋ถ€๋ถ„
  • com.hangum.tadpole.feature : ์˜ฌ์ฑ™์ด feature
  • com.hangum.tadpole.feature.site : buckminster๊ด€๋ จ ์ฝ”๋“œ ํฌํ•จ๋œ feature
  • com.hangum.tadpole.manager.core : ์œ ์ € ๊ด€๋ฆฌ ์ฝ”๋“œ
  • com.hangum.tadpole.mongodb.core : ๋ชฝ๊ณ ๋””๋น„ ๊ด€๋ จ ๋ฉ”์ธ(๋””๋น„ ๋ฐ ์ฝœ๋ ‰์…˜ ๋ฆฌ์ŠคํŠธ๋Š” rap.core์—์„œ ์‚ฌ์šฉ)
  • com.hangum.tadpole.mongodb.core.test : ๋ชฝ๊ณ ๋””๋น„ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ
  • com.hangum.tadpole.mongodb.model : Mongodb ๋ชจ๋ธ ์ •์˜(ํ˜„์žฌ๋Š” ERD ํ”„๋กœ์ ํŠธ์—์„œ๋งŒ ์‚ฌ์šฉ)
  • com.hangum.tadpole.mongodb.erd.core : Mongodb ERD
  • com.hangum.tadpole.preference : ํ”„๋ฆฌํผ๋Ÿฐ์Šค ์ฝ”๋“œ
  • com.hangum.tadpole.secret.util : ์˜ฌ์ฑ™์ด ํ™•์žฅ์„ ์œ„ํ•œ ์ฝ”๋“œ
  • com.hangum.tadpole.importdb : Data Import ๊ด€๋ จ ์ฝ”๋“œ
  • com.hangum.tadpole.cipher.core : Data ๋ณด์•ˆ๊ด€๋ จ ์ฝ”๋“œ
  • com.hangum.tadpole.aws.rds.commons.core : Amazon rDS ๊ด€๋ จ ์ฝ”๋“œ
  • targetProject : target platform ๊ด€๋ จ ์ฝ”๋“œ ๋ฐ ๋„ํ ๋จผํŠธ

dependience

UI ์‹œ์ž‘

  1. com.hangum.db.browser.rap.Application#createUI() : Session ์„ค์ • ํ•ฉ๋‹ˆ๋‹ค.
  2. com.hangum.db.browser.rap.ApplicationWorkbenchAdvisor : ์˜ฌ์ฑ™์ด ํ™ˆ ํŽ˜์ด์ง€ ์˜คํ”ˆ ํ•ฉ๋‹ˆ๋‹ค.
  3. com.hangum.db.browser.rap.ApplicationWorkbenchWindowAdvisor : ์ดˆ๊ธฐ UI์ •์˜, ๋””๋น„์— ํ…Œ์ด๋ธ”์ด ์—†๋‹ค๋ฉด ํ…Œ์ด๋ธ” ๋ฐ ๊ธฐ์ดˆ ์œ ์ € ์ƒ์„ฑ ํ›„์— ๋กœ๊ทธ์ธ ๋‹ค์ด์–ผ๋กœ๊ทธ ์˜คํ”ˆ ํ•ฉ๋‹ˆ๋‹ค.
  4. 3.์ •์ƒ์ด๋ผ๋ฉด com.hangum.db.browser.rap.Perspective ์— ์ •์˜๋œ Database View์™€ Object Explorer view ์˜คํ”ˆํ•ฉ๋‹ˆ๋‹ค.
  5. Database view(com.hangum.db.browser.rap.core.viewers.connections.ManagerViewer)๊ฐ€ ์˜คํ”ˆ๋  ๋•Œ #init()์—์„œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ดˆ๊ธฐ ํ• ๋‹น๋œ ๋””๋น„ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋“ฑ๋กํ•˜๊ณ  ์ดˆ๊ธฐ ์ž‘์—…์„ ๋งˆ๋ฌด๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

์‹œ์ž‘์‹œ ์•„๊ทœ๋จผํŠธ ์„ค๋ช…์€ ๋‹ค์Œ์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค. https://github.com/hangum/TadpoleForDBTools/blob/master/targetProject/docs/engine%20argument%20options.txt

์—”์ง„ ๋””๋น„

  1. data_security : ์ปฌ๋Ÿผ ์•”ํ˜ธํ™” ์ •๋ณด
  2. executed_sql_resource
  3. executed_sql_resource_data
  4. security_class : ์•”ํ˜ธํ™” ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ •๋ณด
  5. account_ext : ์™ธ๋ถ€ ๊ณ„์ • ์ถ”๊ฐ€ ์ •๋ณด
  6. ssh_info : ssh ์—ฐ๊ฒฐ์ •๋ณด
  7. tadpole_system : ์‹œ์Šคํ…œ ๊ธฐ๋ณธ์ •๋ณด
  8. user : ์‚ฌ์šฉ์ž ์ •๋ณด
  9. user_db : ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค
  10. user_db_ext : ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค ํ™•์žฅ ์ •๋ณด
  11. user_db_filter : ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค ์ •๋ณด ํ•„ํ„ฐ
  12. user_db_resource : ์‚ฌ์šฉ์ž ๋ฆฌ์†Œ์Šค ํ—ค๋”
  13. user_db_resource_data : ์‚ฌ์šฉ์ž ๋ฆฌ์†Œ์Šค ๋ฐ์ดํ„ฐ
  14. user_group : ์‚ฌ์šฉ์ž ๊ทธ๋ฃน
  15. user_info_data : ์‚ฌ์šฉ์ž ๋ฐ์ดํ„ฐ
  16. user_role : ์‚ฌ์šฉ์ž ๊ถŒํ•œ

๋””๋น„์˜ ์Šคํฌ๋ฆฝํŠธ๋Š”

  • ์‹œ์Šคํ…œ DB ์ƒ์„ฑ์Šคํฌ๋ฆฝํŠธ๋Š” ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜์„ธ์š”.
  • ์‹œ์Šคํ…œ DB ์ฟผ๋ฆฌ๋Š” ๋‹ค์Œ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

EngineERD

์—”์ง„์—์„œ ์‚ฌ์šฉํ•˜๋Š” Database ๋ณ„ ์ฟผ๋ฆฌ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Database์˜ ๊ธฐ๋ณธ ๊ธฐ๋Šฅ์€ iBatis Framework(http://ibatis.apache.org/)์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. iBatis ์— ๋งคํ•‘ํ•˜๋Š” DAO์˜ ๊ธฐ์ค€์€ MySQL์ž…๋‹ˆ๋‹ค. ์˜ฌ์ฑ™์ด๋Š” ๋‹ค์Œ DB๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ DB์— ๋Œ€ํ•œ ์‹œ์Šคํ…œ Query๋Š” ๋‹ค์Œ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

  1. Amazon RDS:
  2. Cubrid : 8.4.1.2032 ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  3. MsSQL : 2000 ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  4. MySQL : 5.4.x๋กœ ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  5. MariaDB: 5.5.x๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  6. Oracle : 10g - 11g๋กœ ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  7. Postgre: 9.1 ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  8. SQLite : 3.7.2 ๊ธฐ์ค€์œผ๋กœ ์ž‘์—….
  9. MongoDB : 2.0.5 ๊ธฐ์ค€์œผ๋กœ ์ž‘์—…

๋ฐฐํฌ

๋ฐฐํฌ๋Š” ํฌ๊ฒŒ Desktop Application ํƒ€์ž…๊ณผ WARํƒ€์ž… ๋‘๊ฐ€์ง€ ๋ชจ๋“œ๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. Buckminster(com.hangum.tadpole.feature.site)๋กœ ์ž๋™ํ™” ํ•˜๋Š” ์ž‘์—…์ด ์žˆ๊ฒ ์œผ๋‚˜ ์ˆ˜๋™์œผ๋กœ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

  1. Desktop Application : com.hangum.tadpole.application ํ”„๋กœ์ ํŠธ ์•ˆ์— tadpole-standalone.product ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Eclipse Product export wizard๋ฅผ ํด๋ฆญํ•˜์—ฌ ๋ฐฐํฌ ํ•ฉ๋‹ˆ๋‹ค.
  2. WAR : com.hangum.tadpole.build.war ์•ˆ์— tadpole.war.product.warproduct ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Eclipse WAR Product export wizard๋ฅผ ์„ ํƒํ•˜์—ฌ ๋ฐฐํฌ ํ•ฉ๋‹ˆ๋‹ค.