need help on this JDBC error

3 views
Skip to first unread message

ankit nevatia

unread,
Apr 6, 2010, 7:56:58 AM4/6/10
to open-traini...@googlegroups.com
hy,

I am using JSP/Servlet where i am making the connection  with oracle.

here is the error which i am facing

"java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small"

The code is (this is dummy code not the original so all the variable and query is being changed).

    public String temp(String usrnm) {
        CallableStatement cs;

        String combStr;

i had used this to make confirmation but not useful
-------
        StringBuilder sb = new StringBuilder(32000);
        sb.append(usrnm.toUpperCase(Locale.ENGLISH));
-------

        String obj_;
        String fnd_;
        String user_;
        String info_;

        try {
            cs = con.prepareCall(some method);

            cs.registerOutParameter(1, Types.VARCHAR);
            cs.registerOutParameter(2, Types.VARCHAR);
            cs.registerOutParameter(3, Types.VARCHAR);
            cs.registerOutParameter(4, Types.VARCHAR);

this is the original one
//            cs.setString(4, usrnm.toUpperCase(Locale.ENGLISH));

-----------------
            cs.setString(4, sb.toString());
--------------

            cs.execute();
            obj_ = cs.getString(1);
            fnd_ = cs.getString(2);
            user_ = cs.getString(3);
            info_ = cs.getString(4);
            return "done";
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



how get rid of this 

thanks in advance

Reply all
Reply to author
Forward
0 new messages