aspose file tools*
The moose likes Struts and the fly likes Uploading file to postgres database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploading file to postgres database" Watch "Uploading file to postgres database" New topic
Author

Uploading file to postgres database

Eleazar Araujo
Greenhorn

Joined: Oct 20, 2012
Posts: 2
Hi!
I have an application that uses POSTGRESQL, JSP and the STRUTS Framework
I want to insert a file into a table in postgresql using the OID type.

My table definition is this one:

CREATE TABLE mensaje
(
id serial NOT NULL,
file oid,
CONSTRAINT pk_mensaje PRIMARY KEY (id)
)
WITH (
OIDS=TRUE
);
ALTER TABLE mensaje
OWNER TO postgres;


Anybody knows an example of how the Action, the ActionForm and the .jsp should be?
If not, is there any other way to do it without using the OID type?

Thanks
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 485

Hi,

I don't know the PostgreSQL part, but for the upload part with Struts, I suggest you to follow this link:

Upload files with Struts2


PM Me If You Want to get Urgent Help on Java Programming
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading file to postgres database
 
Similar Threads
postgres connection using jsp
Problem with EJB Mapping
java -jar [error] unable to access jarfile postgresql-8.4-702.jdbc.3.jar
Entity Bean Error - SQLException
postgres connection using jsp