TDI-32579: Job reaches the 65K limit in the tDB2Input component

https://jira.talendforge.org/browse/TDI-32579
This commit is contained in:
wang wei
2015-10-09 15:35:50 +08:00
parent de12f1f5a4
commit 5bb33ab0bc

View File

@@ -0,0 +1,68 @@
// ============================================================================
//
// Copyright (C) 2006-2015 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package routines.system;
import java.sql.ResultSet;
import java.util.Date;
public class JDBCUtil {
public static String getString(ResultSet rs, int index, boolean trim) throws java.sql.SQLException {
String result = rs.getString(index);
if (trim && result != null) {
return result.trim();
}
return result;
}
public static Double getDoubleObject(ResultSet rs, int index) throws java.sql.SQLException {
if (rs.getObject(index) != null) {
return rs.getDouble(index);
}
return null;
}
public static Boolean getBooleanObject(ResultSet rs, int index) throws java.sql.SQLException {
if (rs.getObject(index) != null) {
return rs.getBoolean(index);
}
return null;
}
public static double getDouble(ResultSet rs, int index) throws java.sql.SQLException {
if (rs.getObject(index) != null) {
return rs.getDouble(index);
}
throw new RuntimeException("Null value in non-Nullable column");
}
public static boolean getBoolean(ResultSet rs, int index) throws java.sql.SQLException {
if (rs.getObject(index) != null) {
return rs.getBoolean(index);
}
throw new RuntimeException("Null value in non-Nullable column");
}
public static Date getDate(ResultSet rs, int index) throws java.sql.SQLException {
if(rs.getTimestamp(index) != null) {
return new Date(rs.getTimestamp(index).getTime());
}
return null;
}
}