BottomlineJDBC底层驱动

联合创作 · 2023-09-30 18:30

Bottomline 是一个底层的JDBC接口,用于直接从jar文件中加载数据库驱动程序,其结构如下图所示

示例代码

Class.forName("xeus.bottomline.BottomlineDriver");

Properties props = new Properties();
props.put("user", "root");
props.put("password", "root");
props.put("jar","D:\\database-drivers\\mysql-connector-java-5.0.3\\mysql-connector-java-5.0.3-bin.jar");
props.put("class", "com.mysql.jdbc.Driver");

Connection conn = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB", props);

/*
In version 1.2 or later.
The connection parameters can be passed as Query String to the connection URL
*/

Connection conn1 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?user=root&password=root"
                         + "
&jar=D:\\database-drivers\\mysql-connector-java-5.0.3\\mysql-connector-java-5.0.3-bin.jar"
                         +
"&class=com.mysql.jdbc.Driver");

// And also like the following

Connection conn2 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?"
                        + "
&jar=D:\\database-drivers\\mysql-connector-java-5.0.3\\mysql-connector-java-5.0.3-bin.jar
"
                        +
"&class=com.mysql.jdbc.Driver", "root", "root");

编者:我觉得这个项目实在有点脱裤子放屁!

浏览 8
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报