Eclipse怎么连接并打开oracle等数据库
相关话题
如果能在Eclipse中,将oracle等数据库打开,用更直观的视图去观察数据库中的内容,会使开发更加顺利,本文小编介绍Eclipse连接并打开oracle等数据库的方法!
Eclipse连接并打开oracle等数据库的方法
请先保证oracle可以正常运行。

打开Eclipse,找到“Window”--“Show View”--“Other...”

在弹出的新窗口中,打开文件夹“Data Management”找到“Data Source Explorer”,并单击“OK”。

这时候,Eclipse主界面下方会多出一个“Data Source Explorer”标签栏,在其中“Database Connections”文件夹图标上单击右键,选中“New...”。

出现新窗口,找到自己正在使用的数据库"Oracle",自行起个名字,小编在此起了"cityinfo"这个名字。然后单击“Next>”
如下图所示:

出现如下窗口时,请单击右上方图中所示的符号(位置),注意此步骤。

紧接上步,在新的对话框中,找到你所使用的oracle版本,建议选用Oracle Thin Driver,灵活,方便。

找到JAR List,若大家使用的是oracle11,请将其中的ojdbc14给remove掉,否则,Eclipse会不停提示出错。

按着上一步remove掉ojdbc14后,请导入目前你正使用的oracle的驱动包,小编用的是oracle11,因此,需要导入ojdbc6,这一驱动包在oracle安装文件中就有,关于具体位置大家可参考小编另一篇相关经验所详述的。


进入properties标签栏,输入自己所建数据库相关内容,小编在oracle中建的用户名是“cityinfo”。这一步各自的信息可能不同,请自行决定。然后单击“OK”。

上步点击“OK”后,会返回前一个窗口,这时,Eclipse会提示要求输入"user name"用户名,就是大家所建立的数据库的名称,不是任意起的名字。输入后,可单击下方的"Test Connection",当提示“Ping Successed!”时,表示Eclipse和oracle连接成功。然后单击“Finish”完成配置。


此时,要做的工作就是在Eclipse中,用视图显示出所建数据库中的各表。
回到Eclipse主界面,找到如下图所示位置,在"tables"中,任意表点击右键,选择“Data”--"Sample Contents"

出现新的标签栏SQL Results,里面显示的就是数据库中所存的表的信息,小编在该表中暂未插入任何数据。
至此,Eclipse和oracle的连接,以及显示数据库中表的内容就都完成了。接着就可以进行后面的开发工作了。

END
Eclipse怎么连接并打开oracle等数据库的评论条评论