| | |
| | | import java.sql.SQLException; |
| | | import java.sql.Statement; |
| | | import java.sql.Types; |
| | | import java.util.ArrayList; |
| | | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | private FileOutputStream fos = null; |
| | | private FileChannel fch = null; |
| | | private int logCount = 0; |
| | | private ArrayList<byte[]> dgnFileHeader = null; |
| | | |
| | | public OracleElementLogger(Connection connection) |
| | | { |
| | |
| | | logger.warn("connection is null"); |
| | | return; |
| | | } |
| | | |
| | | if (dgnFileHeader != null) |
| | | { |
| | | for (byte[] raw : dgnFileHeader) |
| | | { |
| | | putElementIntoStream(raw); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | dgnFileHeader = new ArrayList<byte[]>(); |
| | | String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | | PrintfFormat spf = new PrintfFormat(fetchSrcStmtFmt); |
| | | String fetchSrcStmt = spf.sprintf(new Object[]{currentSchema, TAB_IGDSSEED}); |
| | |
| | | |
| | | if (raw != null) |
| | | { |
| | | dgnFileHeader.add(raw); |
| | | putElementIntoStream(raw); |
| | | } |
| | | } |
| | | rsSrc.close(); |
| | | stmtSrc.close(); |
| | | } |
| | | |
| | | private void putElementIntoStream(byte[] raw) throws IOException |
| | |
| | | byte[] chunk = new byte[optimalSize]; |
| | | InputStream is = blob.getBinaryStream(0); |
| | | ByteBuffer buffer = null; // ByteBuffer.allocate(optimalSize); |
| | | int len = 0; |
| | | int len; |
| | | |
| | | try |
| | | { |
| | |
| | | fch = null; |
| | | } |
| | | } |
| | | |
| | | public boolean isSchemaChanged() |
| | | { |
| | | return schemaChanged; |
| | | } |
| | | } |