java.sql.SQLException: Bigger type length than Maximum

Posted on 2006-04-04
Last Modified: 2011-09-20
00:46:12,171 INFO  [STDOUT] java.sql.SQLException: Bigger type length than Maximum
00:46:12,203 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.throwSqlException(
00:46:12,234 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.throwSqlException(
00:46:12,265 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.check_error(
00:46:12,281 INFO  [STDOUT]     at oracle.jdbc.driver.T4CMAREngine.buffer2Value(
00:46:12,312 INFO  [STDOUT]     at oracle.jdbc.driver.T4CMAREngine.unmarshalUB2(
00:46:12,343 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(
00:46:12,375 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIdcb.receiveFromRefCursor(
00:46:12,390 INFO  [STDOUT]     at oracle.jdbc.driver.T4CResultSetAccessor.unmarshalOneRow(
00:46:12,421 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
00:46:12,453 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
00:46:12,484 INFO  [STDOUT]     at oracle.jdbc.driver.T4C8Oall.receive(
00:46:12,500 INFO  [STDOUT]     at oracle.jdbc.driver.T4CCallableStatement.doOall8(
00:46:12,531 INFO  [STDOUT]     at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(
00:46:12,562 INFO  [STDOUT]     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
00:46:12,593 INFO  [STDOUT]     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.j
00:46:12,625 INFO  [STDOUT]     at oracle.jdbc.driver.OraclePreparedStatement.execute(
00:46:12,640 INFO  [STDOUT]     at oracle.jdbc.driver.OracleCallableStatement.execute(
00:46:12,671 INFO  [STDOUT]     at com.mailamerica.wts.DAO.OracleLoginDAO.login(Unknown Source)
00:46:12,703 INFO  [STDOUT]     at com.mailamerica.wts.LoginAction.execute(Unknown Source)
00:46:12,734 INFO  [STDOUT]     at org.apache.struts.action.RequestProcessor.processActionPerform(
00:46:12,750 INFO  [STDOUT]     at org.apache.struts.action.RequestProcessor.process(
00:46:12,781 INFO  [STDOUT]     at org.apache.struts.action.ActionServlet.process(
00:46:12,812 INFO  [STDOUT]     at org.apache.struts.action.ActionServlet.doPost(
00:46:12,843 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(
00:46:12,859 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(
00:46:12,890 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
00:46:12,921 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
00:46:12,953 INFO  [STDOUT]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
00:46:12,968 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
00:46:13,000 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
00:46:13,031 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapperValve.invoke(
00:46:13,062 INFO  [STDOUT]     at org.apache.catalina.core.StandardContextValve.invoke(
00:46:13,078 INFO  [STDOUT]     at
00:46:13,109 INFO  [STDOUT]     at
00:46:13,140 INFO  [STDOUT]     at
00:46:13,171 INFO  [STDOUT]     at org.apache.catalina.core.StandardHostValve.invoke(
00:46:13,187 INFO  [STDOUT]     at org.apache.catalina.valves.ErrorReportValve.invoke(
00:46:13,218 INFO  [STDOUT]     at org.apache.catalina.core.StandardEngineValve.invoke(
00:46:13,250 INFO  [STDOUT]     at org.apache.catalina.connector.CoyoteAdapter.service(
00:46:13,281 INFO  [STDOUT]     at org.apache.jk.server.JkCoyoteHandler.invoke(
00:46:13,296 INFO  [STDOUT]     at org.apache.jk.common.HandlerRequest.invoke(
00:46:13,328 INFO  [STDOUT]     at org.apache.jk.common.ChannelSocket.invoke(
00:46:13,359 INFO  [STDOUT]     at org.apache.jk.common.ChannelSocket.processConnection(
00:46:13,390 INFO  [STDOUT]     at org.apache.jk.common.SocketConnection.runIt(
00:46:13,406 INFO  [STDOUT]     at org.apache.tomcat.util.threads.ThreadPool$
00:46:13,437 INFO  [STDOUT]     at

my DAO code is like below:

                      conn = OracleDAOFactory.createConnection();
                      String sql =
                      "{ ? = call validateUser( ? , ? ) }";

                      cstmt = conn.prepareCall(sql);
                      cstmt.registerOutParameter(1, OracleTypes.CURSOR);
                      cstmt.setString(2, username);
                      cstmt.setString(3, pswd);
                            rset = (ResultSet)cstmt.getObject(1);

and my validateUser code is like below:

create or replace package types as
type sqlcur is REF cursor;

create or replace function validateUser(
p_username               PRINCIPALS_TABLE.username%type,
p_password            PRINCIPALS_TABLE.password%type
)return types.sqlcur as
c1 types.sqlcur;

v_username               varchar2(64);
v_password            varchar2(64);


v_username  := p_username;
v_password  := p_password;


p.username ,
name_of_role       role ,
name_of_rolegroup  rolegroup ,
principals_table p ,
roles_table r,
rolegroup_info_table rgi,
role_info_table ri
    p.username = v_username
and p.password = v_password
and p.username = r.username
and r.id_of_rolegroup = rgi.id_of_rolegroup
and r.id_of_role  = ri.id_of_role


I don't see any problem here, can anybody help?

Question by:arthurwang
    LVL 6

    Expert Comment

    try using latest jdbc driver. this seems to be problem with driver and its a known bug.

    Author Comment

    I did copy the ojdbc14.jar from the lib directory of my oracle 10gr2 rac and put it  into the classpath of the compile server. however, when I print out the version of the jdbc driver, it still shows the version of instead of 10.2. I don't know why! should i also need to include the classpath of ojdbc14.jar in the application server?machine used to compile the java source code is different from the applicaton server machine.

    Author Comment

    in fact, I just migrated from 10gr1 single node database to 10gr2 rac with two node, and all datafiles are saved by ASM, someone said it's related to characterset of the ASM, not sure if it's the problem of ASM.

    Author Comment

    I just tried to put the ojdbc14.jar into the classpath of the application server lib directory, then the error message disappear.  I guess that the jdbc driver is loaded dynamically , so it has to be in the classpath of application server, is this the right reason?
    LVL 6

    Accepted Solution

    the server picks up the classes from the jar which is in classpath.
    the jars from the classpath form the runtime environment.
    so if u compile the code using new ojdbc14.jar ......then it doesnt work.
    u will have to put it in runtime classpath.

    Author Comment

    I just don't understand why some components needs to be in  the classpath of run time enviroment, and some don't . is there any way I can identify this?

    Expert Comment

    Can I know where exactly is the classpath that is mentioned by avinthm ?
    I am facing the same issue.
    LVL 6

    Expert Comment

    The classpath i am refering to is Runtime classpath. You can use -classpath option with java command to set runtime classpath.

    java -classpath <path to jar files> <your class with main method>

    documentation :

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now