IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  Java technology  >

An easy JDBC wrapper

A quick data access solution for simple programs

developerWorks


Database.java listing
        
// $Id$
import java.sql.*;
public class Database
{
  private String uri, username, password;
  public Database( String uri, String username, String password ) {
    this.uri = uri;
    this.username = username;
    this.password = password;
  }
  public Table getTable( String name ) {
    return new Table( this, name );
  }
  Connection getConnection() throws SQLException {
    Connection connection =
      DriverManager.getConnection( uri, username, password );
    return connection;
  }
}
      

Return to the article.

    关于 IBM 隐私条约 联系 IBM 使用条款