Eclipse可視化操作資料庫

來源:互聯網
上載者:User

標籤:management   blank   explorer   target   window   

Eclipse可視化操作MySQL

1、開啟Data Source Explorer視窗。

Eclipse > window > show view > other > Data management 選中Data Source Explorer點擊OK,即可在當前頁面開啟。

650) this.width=650;" title="clip_image001" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image001" src="http://s3.51cto.com/wyfs02/M01/6B/CE/wKioL1U3b6bxdxaDAAA_RLME1oE813.jpg" width="244" height="95" />

2、設定資料庫串連。

在Data Source Explorer視窗中點擊Database Connection右鍵,點擊new開啟新視窗。

650) this.width=650;" title="clip_image002" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M02/6B/CE/wKioL1U3b6aRwkWPAABw-L20Vzk856.jpg" width="212" height="244" />

選擇自己的資料庫,點擊next,進入下面這個介面(第一次會碰到,配置好驅動後Eclipse就自動跳過了)

650) this.width=650;" title="clip_image003" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image003" src="http://s3.51cto.com/wyfs02/M00/6B/CE/wKioL1U3b6bB5xXEAABKmJ70y48165.jpg" width="207" height="244" />

點擊用紅框標識的按鈕,進入選擇驅動介面

650) this.width=650;" title="clip_image005" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image005" src="http://s3.51cto.com/wyfs02/M00/6B/D2/wKiom1U3bknznQEdAABmIzt774k766.jpg" width="244" height="202" />

在name/type選項卡中選中你的資料庫驅動版本,(沒有的話就要給Eclipse裝外掛程式了,此處不做贅述)。(順便可以改一下下面的Driver name,為了你所設一堆MySQL驅動名稱衝突)。然後選擇JAR List選項卡,

650) this.width=650;" title="clip_image007" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image007" src="http://s3.51cto.com/wyfs02/M01/6B/D2/wKiom1U3bkqSOgr3AABIM386B6o065.jpg" width="244" height="202" />

可以直接Clear All,刪除原有內容(只有一個jar包名,其實路徑不存在),然後點擊Add JAR/Zip按鈕,添加驅動包(這裡所需驅動jar包,其實就是你java項目串連MySQL的驅動包)。Jar包添加完成,點擊Properties選項卡,

650) this.width=650;" title="clip_image009" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image009" src="http://s3.51cto.com/wyfs02/M01/6B/CE/wKioL1U3b6fS5V1hAABrOE0mano291.jpg" width="244" height="202" />

設定資料庫屬性,包括串連屬性、資料庫名、密碼(那個User ID其實就是那你的資料庫使用者名稱啦),點擊OK。

650) this.width=650;" title="clip_image010" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image010" src="http://s3.51cto.com/wyfs02/M00/6B/CE/wKioL1U3b6fA-EwtAABtJQbZqrY592.jpg" width="207" height="244" />

點擊Finish按鈕,配置完成。

現在點擊開啟Data Source Explorer視窗中的Database Connection檔案夾,變成這樣

650) this.width=650;" title="clip_image011" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image011" src="http://s3.51cto.com/wyfs02/M01/6B/D2/wKiom1U3bkvyLUlSAABU76dbReU754.jpg" width="244" height="100" />

650) this.width=650;" title="clip_image012" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image012" src="http://s3.51cto.com/wyfs02/M01/6B/D2/wKiom1U3bkuh8avSAABgSExngGE756.jpg" width="130" height="244" />

點擊開啟,可以看到你所配置的資料庫。在資料表的上面按右鍵選擇data > edit即可看到你資料表中資料。(load…用於從檔案匯入資料,extract…用於把資料表匯出成檔案。)

3、資料庫的操作

650) this.width=650;" title="clip_image013" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image013" src="http://s3.51cto.com/wyfs02/M02/6B/D2/wKiom1U3bkuzmsBBAABh818wxkM328.jpg" width="233" height="244" />

點擊Open SQL Scrapbook,

650) this.width=650;" title="clip_image015" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image015" src="http://s3.51cto.com/wyfs02/M00/6B/D2/wKiom1U3bkuxL74xAAAdQix6o1g053.jpg" width="244" height="108" />

在scrapbook中寫入sql語句,儲存成sql尾碼的檔案(儲存在項目方便尋找的目錄中)。

在項目目錄下找見該檔案,右鍵,

650) this.width=650;" title="clip_image016" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image016" src="http://s3.51cto.com/wyfs02/M01/6B/D2/wKiom1U3bkuAiYu-AABZg4e4Znw338.jpg" width="244" height="177" />

Execute SQL Files,就會執行scrapbook中的sql語句。

Eclipse可視化操作資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.