BF [ 2188252 ] Make Adempiere build using both jdk 5 and jdk 6 : hide Proxy layer when throwing exceptions
This commit is contained in:
parent
350aea1253
commit
db822559dd
|
@ -13,6 +13,7 @@
|
||||||
package org.compiere.db;
|
package org.compiere.db;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -94,7 +95,14 @@ public class StatementProxy implements InvocationHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
Method m = p_stmt.getClass().getMethod(name, method.getParameterTypes());
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1803,7 +1803,7 @@ public final class DB
|
||||||
* @param e Exception
|
* @param e Exception
|
||||||
* @return SQLException if found or provided exception elsewhere
|
* @return SQLException if found or provided exception elsewhere
|
||||||
*/
|
*/
|
||||||
private static Exception getSQLException(Exception e)
|
public static Exception getSQLException(Exception e)
|
||||||
{
|
{
|
||||||
Throwable e1 = e;
|
Throwable e1 = e;
|
||||||
while (e1 != null)
|
while (e1 != null)
|
||||||
|
|
Loading…
Reference in New Issue