注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
防止SYN泛洪攻击 开启路由器的TC
DNS (domain Name System) 系统的
WebAdmin运行在IIS6下的设定方法
用rsync对邮件服务器进行远程备份
在FreeBSD环境下使用Sybase 11.0
UNIX Sybase安装说明
Sybase系统维护经验谈
AIX下sybase的安装
SYBASE参数设置
SYBASE数据库用户管理基本概念
您现在的位置: 顶尖设计 >> IT学院 >> 编程开发 >> Java >> 文章正文
Sybase JDBC驱动的改进 3
作者:佚名  来源:不详  点击:  更新:2006-12-19
简介:
_SybStatement.java: package com.sybase.jdbc2.jdbc; import java.sql.*;  import java.util.Map;   public class _SybStatement extends P_Statement {  public _SybStatement(Statement outer, Map stupymap) {   super(outer);    this.stupymap = stupymap;   }    public ResultSet getGeneratedKeys() throws SQLException {   String sqlAGK = "SELECT @@identtiy AS AGK";    ResultSet _rsGeneratedKeys = outer.executeQuery(sqlAGK);    return _rsGeneratedKeys;   }    public ResultSet executeQuery(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    ResultSet rs = super.executeQuery(sql);    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }  public int executeUpdate(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql);   }  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, autoGeneratedKeys);   }  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnIndexes);   }  public int executeUpdate(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnNames);   }  public boolean execute(String sql) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql);   }  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, autoGeneratedKeys);   }  public boolean execute(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnIndexes);   }  public boolean execute(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnNames);   }  public ResultSet getResultSet() throws SQLException {   ResultSet rs = super.getResultSet();    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }    Map stupymap;  } _SybPreparedStatement.java package com.sybase.jdbc2.jdbc; import java.sql.*; import java.util.Map;   public class _SybPreparedStatement extends P_PreparedStatement {  public _SybPreparedStatement(PreparedStatement outer, Map stupymap)   throws SQLException   {   super(outer);    this.stupymap = stupymap;   }    public ResultSet getGeneratedKeys() throws SQLException {   String sqlAGK = "SELECT @@identtiy AS AGK";    ResultSet _rsGeneratedKeys = outer.executeQuery(sqlAGK);    return _rsGeneratedKeys;   }  public ResultSet executeQuery(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    ResultSet rs = super.executeQuery(sql);    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }  public int executeUpdate(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql);   }  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, autoGeneratedKeys);   }  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnIndexes);   }  public int executeUpdate(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnNames);   }  public boolean execute(String sql) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql);   }  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, autoGeneratedKeys);   }  public boolean execute(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnIndexes);   }  public boolean execute(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnNames);   }  public ResultSet getResultSet() throws SQLException {   ResultSet rs = super.getResultSet();    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }    public void setObject(int parameterIndex, Object x) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x);   }  public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x, targetSqlType);   }  public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x, targetSqlType, scale);   }  public void setString(int parameterIndex, String x) throws SQLException {   x = CachedCharset.convertTo(x, (String)stupymap.get("charset"));    super.setString(parameterIndex, x);   }  Map stupymap;  } _SybCallableStatement.java package com.sybase.jdbc2.jdbc; import java.sql.*;  import java.util.Map;   public class _SybCallableStatement extends P_CallableStatement {  public _SybCallableStatement(CallableStatement outer, Map stupymap)   throws SQLException   {   super(outer);    this.stupymap = stupymap;   }  public ResultSet getGeneratedKeys() throws SQLException {   String sqlAGK = "SELECT @@identtiy AS AGK";    ResultSet _rsGeneratedKeys = outer.executeQuery(sqlAGK);    return _rsGeneratedKeys;   }  public ResultSet executeQuery(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    ResultSet rs = super.executeQuery(sql);    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }  public int executeUpdate(String sql) throws SQLException {   sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql);   }  public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, autoGeneratedKeys);   }  public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnIndexes);   }  public int executeUpdate(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.executeUpdate(sql, columnNames);   }  public boolean execute(String sql) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql);   }  public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, autoGeneratedKeys);   }  public boolean execute(String sql, int[] columnIndexes) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnIndexes);   }  public boolean execute(String sql, String[] columnNames) throws SQLException {    sql = CachedCharset.convertTo(sql, (String)stupymap.get("charset"));    return super.execute(sql, columnNames);   }  public ResultSet getResultSet() throws SQLException {   ResultSet rs = super.getResultSet();    if (rs == null) return null;    return new _SybResultSet(rs, stupymap);   }    public void setObject(int parameterIndex, Object x) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x);   }  public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x, targetSqlType);   }  public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {   if (x instanceof String)    x = CachedCharset.convertTo((String)x, (String)stupymap.get("charset"));    super.setObject(parameterIndex, x, targetSqlType, scale);   }  public void setString(int parameterIndex, String x) throws SQLException {   x = CachedCharset.convertTo(x, (String)stupymap.get("charset"));    super.setString(parameterIndex, x);   }  Map stupymap;  } _SybResultSet.java package com.sybase.jdbc2.jdbc; import java.sql.*;  import java.util.Map;   public class _SybResultSet extends P_ResultSet {  public _SybResultSet(ResultSet outer, Map stupymap) {   super(outer);    this.stupymap = stupymap;   }  public String getString(int columnIndex) throws SQLException {   String raw = super.getString(columnIndex);    return CachedCharset.castFrom(raw, (String)stupymap.get("charset"));   }    public String getString(String columnName) throws SQLException {   String raw = super.getString(columnName);    return CachedCharset.castFrom(raw, (String)stupymap.g

[1] [2] [3] [4] [5] [6] 下一页






  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务