This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 498

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
 
Consider Paul's rocket mass heater.
 
subject: Uploading file to postgres database
 
Similar Threads
java -jar [error] unable to access jarfile postgresql-8.4-702.jdbc.3.jar
Problem with EJB Mapping
postgres connection using jsp
Entity Bean Error - SQLException
postgres connection using jsp