aspose file tools*
The moose likes JDBC and the fly likes input error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "input error" Watch "input error" New topic
Author

input error

Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
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

Joined: Oct 01, 2001
Posts: 2771
    
  10

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

Joined: Apr 18, 2002
Posts: 315
thansk greg, appreciated that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: input error
 
Similar Threads
inputstream
exception while trying to get the context...
jsp tag library...
Solaris env
Installation of JDriver (weblogic 5.1) for Oracle on Solaris