olgavillamizar
asked on
out of memory
Hi!
I´m trying to take some information from a sap table and then saving it into a sql table.
I use Jco Java connector to do this..
public void makeIn(String ubicacionTecnica) {
Client mConnection = this.getManualConnection() ;
Repository mRepository = this.getRepository(mConnec tion);
mConnection.connect();
ObjetoDAO dao = new ObjetoDAO();
JCO.Function function = null;
JCO.Table codes = null;
try {
dao.eliminarInformeMTO();
function = this.createFunction("ZPMF_ DATOSPM", mRepository);
if (function == null) {
System.out.println("ZPMF_D ATOSPM" + " not found in SAP.");
System.exit(1);
}
JCO.ParameterList input = function.getImportParamete rList();
input.setValue(ubicacionTe cnica,"UBI C_TEC");
mConnection.execute(functi on);
codes = function.getTableParameter List().get Table("T_D ATOSPM");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
EQUNR = codes.getString("EQUNR");
String sql="insert into INFORME_MTO values('"+ EQUNR +"'')";
dao.ingresarDatos(sql);
}
When the code is running I get an error when I try to do the for becouse the original table has aprox 128.000 data and the error is out of memory.
Someone know what I have to do?
Thanks
I´m trying to take some information from a sap table and then saving it into a sql table.
I use Jco Java connector to do this..
public void makeIn(String ubicacionTecnica) {
Client mConnection = this.getManualConnection()
Repository mRepository = this.getRepository(mConnec
mConnection.connect();
ObjetoDAO dao = new ObjetoDAO();
JCO.Function function = null;
JCO.Table codes = null;
try {
dao.eliminarInformeMTO();
function = this.createFunction("ZPMF_
if (function == null) {
System.out.println("ZPMF_D
System.exit(1);
}
JCO.ParameterList input = function.getImportParamete
input.setValue(ubicacionTe
mConnection.execute(functi
codes = function.getTableParameter
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
EQUNR = codes.getString("EQUNR");
String sql="insert into INFORME_MTO values('"+ EQUNR +"'')";
dao.ingresarDatos(sql);
}
When the code is running I get an error when I try to do the for becouse the original table has aprox 128.000 data and the error is out of memory.
Someone know what I have to do?
Thanks
u can either increase the nmemory size or u can alternatively have preparedstatements for the insert statement.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html
https://www.experts-exchange.com/questions/21234533/Out-of-memory.html?query=out+of+memory&topics=86
if you want to coustomize even further the try out
http://blogs.sun.com/roller/resources/watt/jvm-options-list.html
Thank You.
https://www.experts-exchange.com/questions/21234533/Out-of-memory.html?query=out+of+memory&topics=86
if you want to coustomize even further the try out
http://blogs.sun.com/roller/resources/watt/jvm-options-list.html
Thank You.
ASKER
I Use java -XX:+AggressiveHeap but I have the same problem
try -Xmx option by specifying the Heap size suitably my trail & error method.
Thank You.
Thank You.
That's what I suggested: >> Use the -Xmx option to increase the heap-size in Java.
Did you try it?
Did you try it?
mayankeagle i am sorry i didn't see your comment.
:-)
:-)
ASKER
I use it but doesnt work