This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
public class OracleTableCopyUtility { | |
private static final String SOURCE_HOSTNAME = "source_hostname"; | |
private static final String TARGET_HOSTNAME = "target_hostname"; | |
private static final String SOURCE_SCHEMA = "source_schema"; | |
private static final String TARGET_SCHEMA = "target_schema"; | |
private static final String SOURCE_TABLE = "source_table"; | |
private static final String TARGET_TABLE = "target_table"; | |
private static final int NUM_ROWS_TO_COPY = 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.poi.ss.usermodel.*; | |
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
public class CompareTables { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class CompareTables { | |
private static final String DB_URL = "jdbc:oracle:thin:@localhost:1521:xe"; | |
private static final String USER = "username"; | |
private static final String PASS = "password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Guess the number Game | |
key = 43 | |
count = 10 | |
print("Total guesses left = ", count) | |
while True: | |
guess = input("Enter a number to guess\n") | |
if not guess.isnumeric(): | |
print("Enter a valid number") | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// safely handles circular references | |
JSON.safeStringify = (obj, indent = 2) => { | |
let cache = []; | |
const retVal = JSON.stringify( | |
obj, | |
(key, value) => | |
typeof value === "object" && value !== null | |
? cache.includes(value) | |
? undefined // Duplicate reference found, discard key | |
: cache.push(value) && value // Store value in our collection |