• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

ArrayIndex OutOfBounds Exception

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.....
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ":").
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic