⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dao.java

📁 hibernate应用测试,初学hibernate 的会员可以看看.
💻 JAVA
字号:
package com.dao;

import com.config.MySqlConfig;
import com.ibatis.sqlmap.client.SqlMapClient;
import java.sql.SQLException;
import com.tool.pagetool.Page;
import java.util.List;

public  class DAO {
    protected static final SqlMapClient sqlMapper;
    static {
        sqlMapper = MySqlConfig.getSqlMapInstance();
//        System.out.println("sqlMapper.toString()=" + sqlMapper.toString());
    }

    protected static SqlMapClient getSqlMapInstance() {
        return sqlMapper;
    }

    public static void startTransation() throws SQLException {
        sqlMapper.startTransaction();
    }

    public static void startTransation(int i) throws SQLException {
        sqlMapper.startTransaction(i);
    }

    public static void rollback() throws SQLException {
        sqlMapper.endTransaction();
    }

    public static void commit() throws SQLException {
        sqlMapper.commitTransaction();
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -