John--
OutOfMemoryErrors are thrown when the JVM cannot satisfy a memory request;
you might try increasing the available memory to the JVM on startup--use
the '-m' option on the command-line. From within JServ, though, I'm not
sure how to do that--I'm not a JServ expert.
Ted Neward
http://www.javageeks.com/~tneward
On Mon, 6 Dec 1999, John John Tobias wrote:
> Good day!
>
> I'm trying to insert 17.5MB of data in my database using the code below, I
> used the setBinaryStream() method in PreparedStatement class, but the errors
> occured (see "ERROR" section). Then, I tried to insert 940kb of data then
> it's work. Any idea on how to implement and support the large data insertion
> in db? is there a need to reconfigure the Sybase? if so, how? or what
> additional settings that i need? I'm using Sybase as my database, JDBC2.0,
> JDK1.2 and ApacheJserv.
>
> pls kindly help....
>
> Thank's in advance,
>
> John John Tobias
>
>
> ----------------------------------------------------------------------
>
> public class SqlInsert {
>
> Connection conn = null;
>
> SqlInsert() {
> try {
> Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
>
> conn=DriverManager.getConnection("jdbc:sybase:Tds:dev1:4100/pass","pass","pass");
>
> }
>
> catch(Exception e){
> System.out.println( e );
> }
> }
>
> public void Insert() {
>
> Statement stmt = null;
> ResultSet rs = null;
> InputStream istream = null;
>
> try {
>
> FileInputStream f = new FileInputStream( "filedata.txt" );
> PreparedStatement pstmt = conn.prepareStatement("insert into
> attachments(attID,msgID,filename,"
> + "contentType,encoding,attBody) values
> (10,'Dummy'," +"'dummy.dat','text/plain','7bit',?)" );
>
> pstmt.setBinaryStream(1, f, (int)f.available() );
> pstmt.execute();
> pstmt.close();
> f.close();
> }
> catch (Exception e){
> System.out.println( e );
> }
> }
>
> public static void main( String []args ) {
>
> SqlInsert svr = new SqlInsert();
> svr.Insert();
> svr.close();
> }
> }
>
>
> ----------------------------------------------------------------------
> ERROR:
>
>
> Exception in thread "main" java.lang.OutOfMemoryError
> at com.sybase.jdbc2.tds.TdsParam.literalValue(Compiled Code)
> at com.sybase.jdbc2.jdbc.ParamManager.processParamMarkers(Compiled
> Code)
> at com.sybase.jdbc2.tds.Tds.language(Compiled Code)
> at com.sybase.jdbc2.jdbc.SybStatement.sendQuery(Compiled Code)
> at com.sybase.jdbc2.jdbc.SybPreparedStatement.sendQuery(Compiled
> Code)
> at com.sybase.jdbc2.jdbc.SybStatement.execute(Compiled Code)
> at com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(Compiled
> Code)
> at SqlInsert.getStream(Compiled Code)
> at SqlInsert.main(Compiled Code)
>
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html