org.apache.sqoop.lib
Class JdbcWritableBridge
java.lang.Object
org.apache.sqoop.lib.JdbcWritableBridge
public final class JdbcWritableBridge
- extends java.lang.Object
Contains 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.
Method Summary |
static java.math.BigDecimal |
readBigDecimal(int colNum,
java.sql.ResultSet r)
|
static BlobRef |
readBlobRef(int colNum,
java.sql.ResultSet r)
|
static java.lang.Boolean |
readBoolean(int colNum,
java.sql.ResultSet r)
|
static org.apache.hadoop.io.BytesWritable |
readBytesWritable(int colNum,
java.sql.ResultSet r)
|
static ClobRef |
readClobRef(int colNum,
java.sql.ResultSet r)
|
static java.sql.Date |
readDate(int colNum,
java.sql.ResultSet r)
|
static java.lang.Double |
readDouble(int colNum,
java.sql.ResultSet r)
|
static java.lang.Float |
readFloat(int colNum,
java.sql.ResultSet r)
|
static java.lang.Integer |
readInteger(int colNum,
java.sql.ResultSet r)
|
static java.lang.Long |
readLong(int colNum,
java.sql.ResultSet r)
|
static java.lang.String |
readString(int colNum,
java.sql.ResultSet r)
|
static java.sql.Time |
readTime(int colNum,
java.sql.ResultSet r)
|
static java.sql.Timestamp |
readTimestamp(int colNum,
java.sql.ResultSet r)
|
static void |
writeBigDecimal(java.math.BigDecimal val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeBlobRef(BlobRef val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeBoolean(java.lang.Boolean val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeBytesWritable(org.apache.hadoop.io.BytesWritable val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeClobRef(ClobRef val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeDate(java.sql.Date val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeDouble(java.lang.Double val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeFloat(java.lang.Float val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeInteger(java.lang.Integer val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeLong(java.lang.Long val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeString(java.lang.String val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeTime(java.sql.Time val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
static void |
writeTimestamp(java.sql.Timestamp val,
int paramIdx,
int sqlType,
java.sql.PreparedStatement s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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
Copyright © 2013 The Apache Software Foundation