@Override public void writeExternal(ObjectOutput out) throws IOException { out.writeUTF(sessionHandle.toString()); out.writeUTF(database == null ? "default" : database); out.writeUTF(username == null ? "" : username); out.writeUTF(password == null ? "" : password); out.writeInt(resources.size()); for (ResourceEntry resource : resources) { out.writeUTF(resource.getType()); out.writeUTF(resource.getUri()); } out.writeInt(config.size()); for (String key : config.keySet()) { out.writeUTF(key); out.writeUTF(config.get(key)); } out.writeLong(lastAccessTime); out.writeBoolean(markedForClose); out.writeUTF(proxyUser == null ? "" : proxyUser); }
public int insertIntoJobInstanceRunTable(SchedulerJobInstanceRun instanceRun) throws SQLException { String insetSQL = "INSERT INTO " + JOB_INSTANCE_RUN_TABLE + " VALUES(?,?,?,?,?,?,?,?)"; return runner.update(insetSQL, instanceRun.getHandle().getHandleIdString(), instanceRun.getRunId(), instanceRun.getSessionHandle() == null ? "" : instanceRun.getSessionHandle().toString(), instanceRun.getStartTime(), instanceRun.getEndTime(), instanceRun.getResultPath(), instanceRun.getQueryHandle() == null ? "" : instanceRun.getQueryHandle().getHandleIdString(), instanceRun.getInstanceState().name()); }