外贸公司网站模板,百度关键词搜索量排行,怎样做一个网络营销,贵州省住房与城乡建设厅门户网站此次由于学习上面的事情#xff0c;接触到了达梦数据库#xff0c;这是第一次用#xff0c;去年有个关于隐通道的课程设计#xff0c;其实就已经差很少算了解了点点#xff0c;相对与国外主流数据库#xff0c;Dm7有个很明显的特色#xff0c;那就是它的安全级别#x…此次由于学习上面的事情接触到了达梦数据库这是第一次用去年有个关于隐通道的课程设计其实就已经差很少算了解了点点相对与国外主流数据库Dm7有个很明显的特色那就是它的安全级别国外数据卖给中国的最高等级是C2级也就是说根本没有达到B级这就意味这更本就没有强制访问概念而达梦能支持到B级也就支持强制访问java下面介绍在linux下面jdbc链接达梦数据库。linux最新DM7有linux版本在官网能够下载也有安装方法。sqljava代码在安装目录desktop里面的manual里面有以下数据库package lianjie;import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.SQLException;import java.sql.Statement;import javax.imageio.ImageIO;public class BasicApp {// 定义 DM JDBC 驱动串String jdbcString dm.jdbc.driver.DmDriver;// 定义 DM URL 链接串String urlString jdbc:dm://localhost:5236/hive;// 定义链接用户名String userName SYSDBA;// 定义链接用户口令String password SYSDBA;static //定义sql语句//String sqlString create table yujin3(a int,b int,c int);;String sqlString1insert into yujin3 values(123,14,1234);;// 定义链接对象static Connection conn null;//private static String sqlString1;/* 加载 JDBC 驱动程序* throws SQLException 异常 */public void loadJdbcDriver() throws SQLException {try {System.out.println(Loading JDBC Driver...);// 加载 JDBC 驱动程序//DriverManager.registerDriver(new dm.jdbc.driver.DmDriver());Class.forName(jdbcString);} catch (ClassNotFoundException e) {throw new SQLException(Load JDBC Driver Error1: e.getMessage());} catch (Exception ex) {throw new SQLException(Load JDBC Driver Error : ex.getMessage());}}public void connect() throws SQLException {try {System.out.println(Connecting to DM Server...);// 链接 DM 数据库conn DriverManager.getConnection(urlString, userName, password);} catch (SQLException e) {throw new SQLException(Connect to DM Server Error : e.getMessage());}}/* 关闭链接* throws SQLException 异常 */public void disConnect() throws SQLException {try {// 关闭链接conn.close();System.out.println(close);} catch (SQLException e) {throw new SQLException(close connection error : e.getMessage());}}public static void main(String args[]) {try {BasicApp basicApp new BasicApp();// 加载驱动程序basicApp.loadJdbcDriver();basicApp.connect();PreparedStatement pstmt1 conn.prepareStatement(sqlString1);//pstmt1.setInt(1,11);//pstmt1.setInt(2, 12);//pstmt1.setInt(3, 123);pstmt1.execute();// 关闭语句pstmt1.close();System.out.println(OK!);basicApp.disConnect();} catch (SQLException e) {System.out.println(e.getMessage());}}}在建号的java工程中右击buildpath而后ADD 加入jdbc驱动这里注意DmDriver16支持jdk1.6的相应的1514支持1.51.4而后就可一操做了注意在链接以前要保证Dmserver已经启动。安全至于网上说的要配置classpath我刚开始值配置了classpath并无导入jdbc驱动包不行而后导入就可一了本身以为在导入包以后应该不用配置了学习