介绍
当需要读取azkaban数据库中的longblob数据类型的数据时,可以使用Java连接Mysql数据库的方式进行读取。
代码
代码如下:
public String getErrorLog(){
String returnString = "";
try {
Connection conn = AzkabanClient.getPhoenixConnection(conf);
String s = " select exec_id, enc_type, log from execution_logs where exec_id = 3964 and name = 'http-time-series-hourly' ";
PreparedStatement pstmt = conn.prepareStatement(s);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
int i = rs.getInt("exec_id");
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
EncodingType encType = EncodingType.fromInteger(rs.getInt("enc_type"));
int debug = 0;
byte[] data = rs