java数据库开发之JDBC的完整封装兼容多种数据库

2020-02-19 20:02:37王冬梅

使用的时候直接new一个JDBCUtil类,然后对传入对应的sql语句,例:

public class JDBCTest {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		JDBCUtil jdbcUtil = new JDBCUtil("com.mysql.jdbc.Driver",
		"jdbc:mysql://localhost:3306/myhelp?useUnicode=true&characterEncoding=utf-8&useSSL=false","root","142014068");
		String sql = "delete from menu_detial where count=6";
		System.out.println(jdbcUtil.executeUpdate(sql, null));
	}
}

更多关于java数据库开发的文章请查看下面的相关链接