• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

input error

 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to open a file with 1 chinese character in UTF format and i read it tried to store into the oracle database.
FileInputStream fis = new FileInputStream(strFileName); // i have define the strfilename
BufferedReader breader = new BufferedReader(new InputStreamReader(fis, "UTF-8"));
I got this error:
com.sssw.rt.util.AgoSystemDatabaseException: ORA-01401: inserted value too large
for column
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at com.sssw.rt.util.AgoException.<init>(Compiled Code)
at com.sssw.rt.util.AgoException.<init>(Compiled Code)
at com.sssw.rt.util.AgoApiException.<init>(Compiled Code)
at com.sssw.rt.util.AgoSystemException.<init>(Compiled Code)
at com.sssw.rt.util.AgoUnrecoverableSystemException.<init>(Compiled Code
)
at com.sssw.rt.util.AgoSystemDatabaseException.<init>(Compiled Code)
at com.sssw.srv.ambry.AmbryModifyStatement.prepareAndExecuteUpdate(Compi
led Code)
anyone can help where goes wrong?
 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code you show deals with reading the value from a file, but the exception seems to come from trying to insert it into the database. I'm guessing the problem is the column in the database is defined to contain a single character, but only understands single byte (ASCII) characters. Is it possible to configure your database to support Unicode? Otherwise, you will probably have to break the Unicode into two bytes and store it that way, or convert it back to UTF and store it as between one and three bytes.
 
Jackie Wang
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thansk greg, appreciated that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic