`
jalphaOracle
  • 浏览: 3937 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

关于weblogic.jdbc.oci.Drive的疑惑

阅读更多
我使用的环境是windows xp+Oracle9i+weblogic8.1,配置连接池文件如下:
      <JDBCConnectionPool DriverName="weblogic.jdbc.oci.Driver"
        Name="driver-7" PasswordEncrypted="{3DES}iYHhouKx8s4="
        Properties="user=bjgs;server=test2" Targets="myserver"
        TestConnectionsOnCreate="true" TestConnectionsOnRelease="true"
        TestConnectionsOnReserve="true"
        TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:weblogic:oracle"/>
     <JDBCTxDataSource JNDIName="DataSource1" Name="DataSource1"
        PoolName="driver-7" Targets="myserver"/>
在test2数据库中创建了表testtable,其中有个字段是char(1),插入一条记录,用下面的代码测试:

   try{
        Context initCtx=new InitialContext();
        DataSource ds=(DataSource)initCtx.lookup("DataSource1");
        Connection conn=ds.getConnection();
        Statement stmt=conn.createStatement();
       
        String sql = "select testchar from testtable ";

        ResultSet rs=stmt.executeQuery(sql);
        while(rs.next()) {
           out.println(rs.getString(1));
         }


    }catch(Exception e){
        e.printStackTrace();
    }
没有输出结果,把char(1)改成char(2)后就输出结果了,不明白这是为什么?google也没有找到答案,另外问一下这个驱动在weblogic8.1的哪个包中

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics