Monthly Archives: April 2011

Bunch of CSV Files Upload to PostgreSQL

/** * This is for load Oracle to PostgressQL */ public void loadToPostgresDBUpload() { try { for(int k=1;k<=totCounter;k++) { Statement stmt1 = null; stmt1 = connDST.createStatement(); String query1 = "copy croretable from '//home//ashoka//Desktop//orcl//OracleToCSV"+k+".csv' using delimiters ',' "; stmt1.executeUpdate(query1); } }catch … Continue reading

Rate this:

| Leave a comment

Oracle table Export to CSV

import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.sql.*; public class DBMigration { Connection connSRC = null; Connection connDST = null; int intColCount = 0; Statement stmt = null; ResultSet rs = null; int totCounter=0; private long recordsCount=0; public … Continue reading

Rate this:

| Leave a comment