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

📄 connectionmanager.java

📁 css+Ajax技术实现学员分数查看的功能
💻 JAVA
字号:
package com.accp.teem.server.dao ;

/**
 * <p>Title: 验证码注册</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: 北大青鸟ACCP软件制作</p>
 *
 * @author 廖启全
 * @version 1.0
 */
import java.sql.* ;

public class ConnectionManager
{
  public static Connection getConnection() throws Exception
  {
    Connection conn = null ;
    try
    {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
      conn = DriverManager.getConnection("jdbc:odbc:student") ;
    }
    catch(Exception ex)
    {
      throw ex ;
    }
    return conn ;
  }

  public static void Close(Connection conn) throws Exception
  {
    try
    {
      if(conn != null)
      {
        conn.close() ;
      }
    }
    catch(SQLException ex)
    {
      throw ex ;
    }
  }

  public static void Close(Statement stmt) throws Exception
  {
    try
    {
      if(stmt != null)
      {
        stmt.close() ;
      }
    }
    catch(SQLException ex)
    {
      throw ex ;
    }
  }

  public static void Close(ResultSet rs) throws Exception
  {
    try
    {
      if(rs != null)
      {
        rs.close() ;
      }
    }
    catch(SQLException ex)
    {
      throw ex ;
    }
  }

  public static void Close(Connection conn, Statement stmt, ResultSet rs) throws Exception
  {
    try
    {
      if(rs != null)
      {
        rs.close() ;
      }

      if(stmt != null)
      {
        stmt.close() ;
      }

      if(conn != null)
      {
        conn.close() ;
      }
    }
    catch(SQLException ex)
    {
      throw ex ;
    }
  }

}

⌨️ 快捷键说明

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