Tim wrote:
> I am trying to connect from an Android device to a remote HSQLDB web
> database server using:
> 
> DriverManager.getConnection("jdbc:hsqldb:http://
> remoteserveripaddress:port","user","pwd")
> 
> But in logcat I get errors:
> 
> Rejecting allocation of 1011373133-element array
> java.sql.SQLException: Connection is broken: java.lang.InternalError:
> array size too large
> 
> Before trying to connect I do a System.gc()
> My FreeMemory is 1355832, MaxMemory is 16777216, TotalMemory is
> 5185504
> 
> Have I run out of memory?
> How do I release more memory?
> 
> Any ideas greatly appreciated.

You are not going to be able to allocate a 1-billion-element array. To
put that in perspective, that's 4GB, if every element is only 4 bytes.

I suggest that you write a REST Web service and access your remote SQL
database using it. I do not recommend JDBC on mobile platforms for
access to remote databases.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to