BF [ 2188252 ] Make Adempiere build using both jdk 5 and jdk 6 : hide Proxy layer when throwing exceptions

This commit is contained in:
teo_sarca 2008-12-06 17:28:57 +00:00
parent 350aea1253
commit db822559dd
2 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,7 @@
package org.compiere.db;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.ResultSet;
@ -94,7 +95,14 @@ public class StatementProxy implements InvocationHandler {
}
Method m = p_stmt.getClass().getMethod(name, method.getParameterTypes());
return m.invoke(p_stmt, args);
try
{
return m.invoke(p_stmt, args);
}
catch (InvocationTargetException e)
{
throw DB.getSQLException(e);
}
}
/**

View File

@ -1803,7 +1803,7 @@ public final class DB
* @param e Exception
* @return SQLException if found or provided exception elsewhere
*/
private static Exception getSQLException(Exception e)
public static Exception getSQLException(Exception e)
{
Throwable e1 = e;
while (e1 != null)