如何应用MyEclipse开发工具中的数据库导航工具Database Explorer连接和操作数据库Word格式文档下载.docx
《如何应用MyEclipse开发工具中的数据库导航工具Database Explorer连接和操作数据库Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《如何应用MyEclipse开发工具中的数据库导航工具Database Explorer连接和操作数据库Word格式文档下载.docx(14页珍藏版)》请在冰豆网上搜索。
4)ExportasPNG、JPG和BMP
(3)SQLEditor
1)Syntaxcolorhighlighting
2)Tableandcolumnnamehighlighing
3)Tableandcolumnnameauto-completion(Ctrl+Space)
4)AssociateeditorwithdatabaseconnectionandexecuteSQLsnippets
(4)Multipledatabaseconnectionmanagement
(5)SQLgenerationutilities(seeFigure3)
同时对Oracle数据库加以特殊的支持,以及支持目前各种商业和开源数据库系统
2、DatabaseExplorer界面的主要部分
(1)DatabaseExplorerPerspective
MyEclipse数据库的资源管理器(DatabaseExplorer)可以直接访问企业级的数据库存储系统,并提供以下的功能:
Anorganizationofdatabasetoolsandfeaturesfordatabaseapplicationdevelopment.Thecontentandlayoutoftheperspective'
suser-interfacelayoutisusercustomizable。
(2)DBBrowser
ManagesmultipleDBConnectionProfilesandactiveDBconnections;
providesatreeviewforhierarchicalnavigationofdatabaseinformationandcontext-menuactions.
(3)SQLEditor(SQL编辑器)
AdvancedtexteditorwithSQLcodeassistandcolorhighlighting;
executeselectedSQLsnippetsortheentirefilecontentsonanactiveconnection.
通过右键单击在数据库浏览器中打开SQL编辑器连接,并从菜单中选择新的SQL编辑器。
或者双击某个SQL或DDL文件可以打开SQL编辑器窗口。
然后可以在SQL编辑器中输入相关的SQL语句并先后执行它们。
(4)InformationalViews
DisplaysofvariousinformationalviewsincludingSQLqueryresultsandqueryhistory,tableanddatabaseconnectioninformation.
3、打开DatabaseExplorerPerspective透视图的功能界面
(1)启动DatabaseExplorerPerspective透视图
可以通过如下的菜单项所提供的命令启动DatabaseExplorerPerspective透视图。
或者应用如下的方式启动DatabaseExplorerPerspective透视图:
(2)最后出现下面的结果界面
4、利用DatabaseExplorer配置数据库的JDBCDriver驱动程序
(1)OpentheDatabaseDriverManager
FromtheMyEclipsemenubarselectWindow>
Preferences>
MyEclipse>
DatabaseExplorer>
Drivers
其中的各个按钮的功能如下:
1)NewactionenablesyoutocreateanewJDBCdrivertemplate.
2)Editactionwillmodifytheexistingtemplate.
3)Copyactionwillcreateanewtemplatefromthecurrentlyselectedtemplate
(2)ClickNewtoopentheNewJDBCDriverDialog
MyEclipsecomeswithanumberofdrivertemplatesthatcanbeusedtoquicklyconfigureyourdriver.如果我们的目标数据库系统为Oracle,则可以SelectOracleThinDriverfromtheDrivertemplatedropdown.
注意:
MyEclipse的数据库资源管理器支持多种数据库服务器,如下为部分数据库系统及数据库连接方式的名称列表:
AxionHypersonicDBInstantDBInterclientFirebird
ODBCBridgejTDSMckoiMicrosoftSQLServer
MimerSQLMySQLOraclePointbasePostgresQLSAPDBSunopsisXMLSybaseThinkSQL
(3)CreatingaConnectionProfile
AConnectionProfiledefinestheJDBCdriverandtheadditiondatabaseconnectionandsessionconfigurationdetailsrequiredtoconnecttoyourdatabase.TheDatabaseBrowsermanagesconnectionprofilesandtheirresultingdatabasesessions
1)OpentheDatabaseExplorerPerspective,FromtheDatabaseBrowserviewselecttheNewConnectionProfileicon
2)输入下面的各个方面的信息
(4)CreatingaDatabaseSession
FromtheDatabaseBrowserselecttheconnectionprofiletoopen,Selecteitherthetoolbar"
Open"
orright-clickingandselecting"
Openconnection..."
。
(5)将出现我们的数据库中的信息
(6)ClosingaDatabaseSession
InordertoterminateanactivedatabasesessionyoumuchclosetheDatabaseBrowserconnectiontoit.SelecttheconnectionintheDatabaseBrowserthatyouwishtoclose.,Selectthe"
Closeconnection"
actionfromtheviewtoolbarorthe"
right-click"
context-menu.
(7)DatabaseSessionTimeoutsandReconnection
DatabasesessioncanterminateunexpectedforanumberofreasonsbeyondMyEclipsecontrol.Forexamplemanydatabaseswilltimeoutyoursessionyoursessionforinactivity.
Ifyourdatabasesessionisterminatedforsomereason,theDatabaseExplorerwilldetectthisandpromptyoutoreconnect.
但开发者可以specifythedefaultreconnectionstrategyintheDatabaseExplorerpreferencepage。
具体的方法为:
Window>
DatabaseExplorer
5、利用DatabaseExplorer浏览数据库表的信息
Withthedatabaseconnectionestablished,expandtheconnectionnodeintheDatabaseBrowsertoviewthedatabasestructure
6、执行SQL语句
(1)OpenanewSQLEditorbyselectingFile>
New>
SQLEditor
(2)Selectthedatabaseconnectionandschematowhichthiseditorwillbeassociated
(3)设置
(4)输入SQL语句
(5)执行SQL语句
(6)将产生出下面的结果