Package org.apache.sqoop.lib
Class JdbcWritableBridge
- java.lang.Object
-
- org.apache.sqoop.lib.JdbcWritableBridge
-
public final class JdbcWritableBridge extends java.lang.ObjectContains a set of methods which can read db columns from a ResultSet into Java types, and do serialization of these types to/from DataInput/DataOutput for use with Hadoop's Writable implementation. This supports null values for all types.
-
-
Field Summary
Fields Modifier and Type Field Description static longMAX_BLOB_LENGTHstatic longMAX_CLOB_LENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.math.BigDecimalreadBigDecimal(int colNum, java.sql.ResultSet r)static BlobRefreadBlobRef(int colNum, java.sql.ResultSet r)static java.lang.BooleanreadBoolean(int colNum, java.sql.ResultSet r)static org.apache.hadoop.io.BytesWritablereadBytesWritable(int colNum, java.sql.ResultSet r)static ClobRefreadClobRef(int colNum, java.sql.ResultSet r)static java.sql.DatereadDate(int colNum, java.sql.ResultSet r)static java.lang.DoublereadDouble(int colNum, java.sql.ResultSet r)static java.lang.FloatreadFloat(int colNum, java.sql.ResultSet r)static java.lang.IntegerreadInteger(int colNum, java.sql.ResultSet r)static java.lang.LongreadLong(int colNum, java.sql.ResultSet r)static java.lang.StringreadString(int colNum, java.sql.ResultSet r)static java.sql.TimereadTime(int colNum, java.sql.ResultSet r)static java.sql.TimestampreadTimestamp(int colNum, java.sql.ResultSet r)static voidwriteBigDecimal(java.math.BigDecimal val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteBlobRef(BlobRef val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteBoolean(java.lang.Boolean val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteBytesWritable(org.apache.hadoop.io.BytesWritable val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteClobRef(ClobRef val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteDate(java.sql.Date val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteDouble(java.lang.Double val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteFloat(java.lang.Float val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteInteger(java.lang.Integer val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteLong(java.lang.Long val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteString(java.lang.String val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteTime(java.sql.Time val, int paramIdx, int sqlType, java.sql.PreparedStatement s)static voidwriteTimestamp(java.sql.Timestamp val, int paramIdx, int sqlType, java.sql.PreparedStatement s)
-
-
-
Field Detail
-
MAX_BLOB_LENGTH
public static final long MAX_BLOB_LENGTH
- See Also:
- Constant Field Values
-
MAX_CLOB_LENGTH
public static final long MAX_CLOB_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
readInteger
public static java.lang.Integer readInteger(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readLong
public static java.lang.Long readLong(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readString
public static java.lang.String readString(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readFloat
public static java.lang.Float readFloat(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readDouble
public static java.lang.Double readDouble(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readBoolean
public static java.lang.Boolean readBoolean(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readTime
public static java.sql.Time readTime(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readTimestamp
public static java.sql.Timestamp readTimestamp(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readDate
public static java.sql.Date readDate(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readBytesWritable
public static org.apache.hadoop.io.BytesWritable readBytesWritable(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readBigDecimal
public static java.math.BigDecimal readBigDecimal(int colNum, java.sql.ResultSet r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readBlobRef
public static BlobRef readBlobRef(int colNum, java.sql.ResultSet r) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
readClobRef
public static ClobRef readClobRef(int colNum, java.sql.ResultSet r) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
writeInteger
public static void writeInteger(java.lang.Integer val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeLong
public static void writeLong(java.lang.Long val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeDouble
public static void writeDouble(java.lang.Double val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeBoolean
public static void writeBoolean(java.lang.Boolean val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeFloat
public static void writeFloat(java.lang.Float val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeString
public static void writeString(java.lang.String val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeTimestamp
public static void writeTimestamp(java.sql.Timestamp val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeTime
public static void writeTime(java.sql.Time val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeDate
public static void writeDate(java.sql.Date val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeBytesWritable
public static void writeBytesWritable(org.apache.hadoop.io.BytesWritable val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeBigDecimal
public static void writeBigDecimal(java.math.BigDecimal val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
writeBlobRef
public static void writeBlobRef(BlobRef val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
writeClobRef
public static void writeClobRef(ClobRef val, int paramIdx, int sqlType, java.sql.PreparedStatement s) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-