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 (SQLException se)
{
System.out.println("Couldn't Connect to Database:"+se);
se.printStackTrace();
}
catch(Exception exe)
{
System.out.println("Function name :loadToPostgresDBUpload");
System.out.println("Error:"+exe);
}
}

About ashokabhat

I am a C,C ,JAVA,Adobe Flex,.NET Programmer Currently working as a Software Developer
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s