Hello everybody, i explain the scenario: i need thru web browser to retrieve a file (we suppose a pdf file) stored in a longblob column in a table from a mysql database.i do this launching a lotus script agent scheduled (option never) in a server domino wich call a java class from a java library with the following code:
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(java.lang.ClassNotFoundException e){
e.printStackTrace();
}
dbConn = DriverManager.getConnection("jdbc:mysql://logicalhostname/mysqldatabasename?user=userid&password=password");
dbConn.setAutoCommit(false);
String qry = "SELECT body FROM allegati WHERE IDCiclo = '"+idciclo+"' AND IDDoc = '"+iddoc+"' AND NomeModulo = '"+nomeModulo+"' AND NomeCampo = '"+nomeCampo+"'";
PreparedStatement prep = dbConn.prepareStatement(qry);
rs = prep.executeQuery();
if(rs.next()){
blob = (byte[])rs.getObject("body");
}
}
finally…end of class…
well, does anybody know why my server domino crashes if the pdf i must retrieve has 800k size while everything works well if i deal with a 2-3 k size file??? the server stops not always at the same point but sometimes at connection level…other times at preparedstatement…rarely in the finally step when i call close method for connection variable…
i tried with “mysql-connector-java-3.0.11-stable-bin.jar” and with “mysql-connector-java-3.0.17-stable-bin.jar”.
Any help will be greatly appreciated…thanks in advance to everybody.
Regards, Daniele.