• <legend id='4FbSW'><style id='4FbSW'><dir id='4FbSW'><q id='4FbSW'></q></dir></style></legend>
    1. <tfoot id='4FbSW'></tfoot>

      <small id='4FbSW'></small><noframes id='4FbSW'>

        <i id='4FbSW'><tr id='4FbSW'><dt id='4FbSW'><q id='4FbSW'><span id='4FbSW'><b id='4FbSW'><form id='4FbSW'><ins id='4FbSW'></ins><ul id='4FbSW'></ul><sub id='4FbSW'></sub></form><legend id='4FbSW'></legend><bdo id='4FbSW'><pre id='4FbSW'><center id='4FbSW'></center></pre></bdo></b><th id='4FbSW'></th></span></q></dt></tr></i><div id='4FbSW'><tfoot id='4FbSW'></tfoot><dl id='4FbSW'><fieldset id='4FbSW'></fieldset></dl></div>
        • <bdo id='4FbSW'></bdo><ul id='4FbSW'></ul>

      1. 使用准备好的语句进行选择查询时出现 SQL 异常

        时间:2023-09-30
        <legend id='hfrxR'><style id='hfrxR'><dir id='hfrxR'><q id='hfrxR'></q></dir></style></legend>
      2. <tfoot id='hfrxR'></tfoot>

            <bdo id='hfrxR'></bdo><ul id='hfrxR'></ul>

                <tbody id='hfrxR'></tbody>
                <i id='hfrxR'><tr id='hfrxR'><dt id='hfrxR'><q id='hfrxR'><span id='hfrxR'><b id='hfrxR'><form id='hfrxR'><ins id='hfrxR'></ins><ul id='hfrxR'></ul><sub id='hfrxR'></sub></form><legend id='hfrxR'></legend><bdo id='hfrxR'><pre id='hfrxR'><center id='hfrxR'></center></pre></bdo></b><th id='hfrxR'></th></span></q></dt></tr></i><div id='hfrxR'><tfoot id='hfrxR'></tfoot><dl id='hfrxR'><fieldset id='hfrxR'></fieldset></dl></div>
              1. <small id='hfrxR'></small><noframes id='hfrxR'>

                  本文介绍了使用准备好的语句进行选择查询时出现 SQL 异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  StringBuilder sqlQry = new StringBuilder();
                  sqlQry.append("SELECT LIB, PATH")
                  .append(" FROM OBJ")
                  .append(" INNER JOIN SRC ON SRC.MBR = OBJ.LOBJ")
                  .append(" WHERE  TYPE = '*PGM'")
                  .append(" AND SRC.PATH LIKE '").append("?").append("%'");
                  
                  PreparedStatement ps = accssConn.prepareStatement(sqlQry.toString());
                  ps.setString(1, path);
                  
                  rs = ps.executeQuery();
                  

                  大家好,我收到以下异常

                  Hi All, I am getting following exception

                  [jcc][10145][10844][3.63.123] Invalid parameter 1: Parameter index is out of range. ERRORCODE=-4461, SQLSTATE=42815
                  

                  列限制为 255,路径为 = "C:Documents and SettingsxyzDesktopxyzs" 并且在语句中运行良好.那么,它在准备好的语句中抛出异常的原因是什么.

                  column limit is 255 and path is = "C:Documents and SettingsxyzDesktopxyzs" and it is run fine with statement.So , what is the reason that it is throwing exception in prepared statement.

                  推荐答案

                  StringBuilder sqlQry = new StringBuilder();
                  
                  sqlQry.append("SELECT LIB, PATH")
                  .append(" FROM OBJ")
                  .append(" INNER JOIN SRC ON SRC.MBR = OBJ.LOBJ")
                  .append(" WHERE  TYPE = '*PGM'")
                  .append(" AND SRC.PATH LIKE ").append("?");
                  
                  PreparedStatement ps = accssConn.prepareStatement(sqlQry.toString());
                  
                  ps.setString(1, path + "%");
                  

                  这篇关于使用准备好的语句进行选择查询时出现 SQL 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:发生 DB2 连接授权失败原因:Java 中不支持安全机制 下一篇:JPA 2.0 Provider Hibernate 3.6 for DB2 v9.5 type 2 驱动程序

                  相关文章

                  最新文章

                  <legend id='SiZMH'><style id='SiZMH'><dir id='SiZMH'><q id='SiZMH'></q></dir></style></legend>

                  <small id='SiZMH'></small><noframes id='SiZMH'>

                    <tfoot id='SiZMH'></tfoot>
                  1. <i id='SiZMH'><tr id='SiZMH'><dt id='SiZMH'><q id='SiZMH'><span id='SiZMH'><b id='SiZMH'><form id='SiZMH'><ins id='SiZMH'></ins><ul id='SiZMH'></ul><sub id='SiZMH'></sub></form><legend id='SiZMH'></legend><bdo id='SiZMH'><pre id='SiZMH'><center id='SiZMH'></center></pre></bdo></b><th id='SiZMH'></th></span></q></dt></tr></i><div id='SiZMH'><tfoot id='SiZMH'></tfoot><dl id='SiZMH'><fieldset id='SiZMH'></fieldset></dl></div>
                    • <bdo id='SiZMH'></bdo><ul id='SiZMH'></ul>