在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作

在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作  

MyEclipse6.5    ,  mysq驱动jar包为mysql-connector-java-5.1.8-bin.jar

在MyEclipse中添加hibernate支持时需要用到DB Driver所以需要配置

首先选择window-->Open Perspective-->Other

在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning

出现下图:选择MyEclipse Database Explore.

在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning

点击OK后出现如下画面:

在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning

点击右键选择 NEW创建连接,出现下图:Driver template选择 “MySQL Connector/J”

在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning
 
点击Finish后:如下图出现mysql的连接,右键 “mysql”,打开连接。输入密码,连接成功
在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning
 
 
成功后如下图,“Connected to mysql” 为一个连接到mysql数据库的连接,右键这个连接
,选则“New SQL Editor”,打开一个窗口
 
在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning
 
可以在打开的窗口中写sql,执行sql语句
 
 
在myeclipse中配置DB Driver(数据库用MySql),并在myeclipse执行sql语句操作 - 雨 - Rainning
原文地址:https://www.cnblogs.com/yuhuameng/p/3850018.html