PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 1st, 2003, 10:28 PM
ketanshah79 ketanshah79 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 ketanshah79 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
remote text file data copy using JBDC

Hi,

I hav text files which i have generated by paring the XML files using the XALAN processor. Now, i want to copy the data in the text file in the database which is on some remote machine. i m using JAVA (JDBC) on the client side. My text file is in the format which is required by the postgresql COPY command(with delimiters). Instead of calling multiple INSERT commands from the client application, i want to somehow send the file(stream or anything) to the database and use the COPY command. Does anyone knows how to get over this problem?

thanks for all ur replies in advance.

Ketan.

Reply With Quote
  #2  
Old November 2nd, 2003, 01:28 PM
metaBarf metaBarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 373 metaBarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 49 m 6 sec
Reputation Power: 6
RU going to have to do this over and over frequently, or more like a batch job? (will it create consistent network traffic?) I am just confused about your approach-- if you parse the XML into INSERT statements for a schema that already exists then you will just run the insert statements. You could run a whole file of INSERTs or COPYs with psql, just run a local script from the java or I am not sure if you can do exec() from a java program but just run the SQL from the file with a psql command.

I've found some stuff in the manual about the COPY command, here .

That's for 7.3, shouldn't be that much different though.

Reply With Quote
  #3  
Old November 2nd, 2003, 05:42 PM
ketanshah79 ketanshah79 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 ketanshah79 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank u so much for ur reply .

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > remote text file data copy using JBDC


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT