Hi everyone,
I'm using MySQL 3.23.49 on AIX 4.3.3, Connector/J 2.13 and IBM JDK 1.3.1.
I wrote a java program that loads CSV files into a MySQL databases. This
program is exectued sevral times evrey night.
But it seems that some times the query that ask the MySQL Server to load the
files, is not issued:
Here is my code:
l_log_stream.println("Loading the ODS table");
try
{
Statement l_stmt = getConnection().createStatement();
String l_query = "LOAD DATA INFILE '" + TMP_FILE_AMF_PATH + m_ent +
m_ets + m_numOfDay + "' REPLACE"
+ " INTO TABLE ODS_AMF FIELDS TERMINATED BY '" + SEP +
"';";
//System.out.println(l_query);
l_stmt.executeUpdate(l_query);
l_query = "LOAD DATA INFILE '" + TMP_FILE_AMP_PATH + m_ent + m_ets +
m_numOfDay + "' REPLACE"
+ " INTO TABLE ODS_AMP FIELDS TERMINATED BY '" + SEP + "';";
//System.out.println(l_query);
l_stmt.executeUpdate(l_query);
getConnection().commit();
}
catch(SQLException p_sqle)
{
throws new LogiqueDataException();
}
l_log_stream.println("ODS table loaded");
Since I only have : "Loading the ODS table", in my log file I guess an
SQLexception is thrown in the try block, and then, the LogiqueDataException
is thrown and causes my program the stop. I checked the MySQL log with
mysqlbinlog and I can't find the query issued by the java program. So it
seems that it's getConnection().createStatement() that throws the
SQLException.
The strange thing is that 99% of the time, this is working perfectly and no
SQLException are thrown.
If anyone had any idea about what could cause this exception, I'd be happy
to hear what he think?
Would it be possible that after a few minutes the connection is closed by
MySQL or the driver?
I'll change my code to get the stack trace, but since this bug doesn't
occure often it might take a while before I'm able to get it. I could also
change the Driver but since the application is deployed I would need to be
sure that it would fix the bug to do so.
Cheers
Julien