aspose file tools*
The moose likes JDBC and the fly likes ArrayIndex OutOfBounds Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ArrayIndex OutOfBounds Exception" Watch "ArrayIndex OutOfBounds Exception" New topic
Author

ArrayIndex OutOfBounds Exception

Subhradip Podder
Ranch Hand

Joined: Aug 27, 2007
Posts: 36
HI All,

I'm face a problem with prepareStatement.
when i run my code,the compiler will give me a "java.lang.ArrayIndexOutOfBoundsException: 28
oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:925)
oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:608)
oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1208)
oracle.jdbc.driver.T4CPreparedStatement.<init>(T4CPreparedStatement.java:29)
oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:70)
oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:881)
oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:787)
org.apache.jsp.report.std_005fcashflow_jsp._jspService(std_005fcashflow_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

"
.
i want to know that there is any limitation of caracter that we can fire within prepareStatement,because my caracter was 10,345.


I write my code like following........

("Select unit||'-'||unit_name Unit,account||'-'||account_name Account,SUM(Amount) Amount "+
"From "+
"(SELECT "+
"'UNAPP' TYPE, "+
"FL.SEGMENT4 UNIT, "+
"FL.SEGMENT5 ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VL FL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('UNAPP') "+
"AND ASR.ACCOUNTING_DATE BETWEEN ? AND ? "+
"AND ASR.TRX_HDR_ID IN "+
"(SELECT DISTINCT CASH_RECEIPT_ID FROM AR_CASH_RECEIPTS_V "+
"WHERE GL_DATE BETWEEN ? AND ?) "+
"AND ASR.CODE_COMBINATION_ID=FL.CODE_COMBINATION_ID "+
"GROUP BY "+
"FL.SEGMENT4, "+
"FL.SEGMENT5, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME "+
"UNION ALL "+
"SELECT "+
"'BANK_CH' TYPE, "+
"FL.SEGMENT4 UNIT, "+
"FL.SEGMENT5 ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VL FL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('BANK_CHARGES') "+
"AND ASR.TRX_HDR_ID IN "+
"(SELECT DISTINCT CASH_RECEIPT_ID FROM AR_CASH_RECEIPTS_V "+
"WHERE GL_DATE BETWEEN ? AND ?) "+
"AND ASR.ACCOUNTING_DATE BETWEEN ? AND ? "+
"AND ASR.CODE_COMBINATION_ID=FL.CODE_COMBINATION_ID "+
"GROUP BY "+
"FL.SEGMENT4, "+
"FL.SEGMENT5, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME "+
"UNION ALL "+
"SELECT "+
"'MISC'TYPE, "+
"FL.SEGMENT4 UNIT, "+
"FL.SEGMENT5 ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VL FL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('MISCCASH') "+
"AND ASR.TRX_HDR_ID IN "+
"(SELECT DISTINCT CASH_RECEIPT_ID FROM AR_CASH_RECEIPTS_V "+
"WHERE GL_DATE BETWEEN ? AND ?) "+
"AND ASR.ACCOUNTING_DATE BETWEEN ? AND ? "+
"AND ASR.CODE_COMBINATION_ID=FL.CODE_COMBINATION_ID "+
"GROUP BY "+
"FL.SEGMENT4, "+
"FL.SEGMENT5, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME "+
"UNION ALL "+
"SELECT "+
"'XCHANGE'TYPE, "+
"FL.SEGMENT4 UNIT, "+
"FL.SEGMENT5 ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VLFL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('EXCH_GAIN','EXCH_LOSS') "+
"AND ASR.TRX_HDR_ID IN "+
"(SELECT DISTINCT CASH_RECEIPT_ID FROM AR_CASH_RECEIPTS_V "+
"WHERE GL_DATE BETWEEN ? AND ?) "+
"AND ASR.ACCOUNTING_DATE BETWEEN ? AND ? "+
"AND ASR.CODE_COMBINATION_ID=FL.CODE_COMBINATION_ID "+
"GROUP BY "+
"FL.SEGMENT4, "+
"FL.SEGMENT5, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME "+
"UNION ALL "+
"SELECT "+
"'ON_ACC'TYPE, "+
"FL.SEGMENT4UNIT, "+
"FL.SEGMENT5ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VLFL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('ACC') "+
"AND ASR.TRX_HDR_ID IN "+
"(SELECT DISTINCT CASH_RECEIPT_ID FROM AR_CASH_RECEIPTS_V "+
"WHERE GL_DATE BETWEEN ? AND ?) "+
"AND ASR.ACCOUNTING_DATE BETWEEN ? AND ? "+
"AND ASR.CODE_COMBINATION_ID=FL.CODE_COMBINATION_ID "+
"GROUP BY "+
"FL.SEGMENT4, "+
"FL.SEGMENT5, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME "+
"UNION ALL "+
"SELECT "+
"'UNID'TYPE, "+
"FL.SEGMENT4 UNIT, "+
"FL.SEGMENT5 ACCOUNT, "+
"FL.UNIT_NAME, "+
"FL.ACCOUNT_NAME, "+
"SUM(NVL(ACCOUNTED_CR,0)-NVL(ACCOUNTED_DR,0)) AS AMOUNT "+
"FROM "+
"AR_AEL_SL_REC_V ASR, "+
"PWC_FLEX_ACC_DESC_VLFL "+
"WHERE ASR.ACCT_LINE_TYPE IN ('UNID') "+
"
...........
..........
..........

Please help me.....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
Google suggests that there may be extraneous newline characters in the query, or that maybe you're mixing JDBC-style parameters (using "?") with Oracle-style parameters (using ":").
Kevin Smither
Ranch Hand

Joined: Oct 22, 2007
Posts: 30
first off the exception you listed is runtime and not reported by the compiler as you state. second, I have not heard about any limit.
 
Consider Paul's rocket mass heater.
 
subject: ArrayIndex OutOfBounds Exception