ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diran Ayandele <Adediran.Ayand...@Sun.COM>
Subject Re: I want to upload a file into the table in the mysql database.
Date Fri, 31 Mar 2006 20:05:18 GMT
I recently made a web to db file loader using the struts FormFile object 
which enables putting the file right into a char array.  This can be 
easily handled by iBatis as such and loads well into an oracle blob 
column (I don't know what the equivalent mySql) column type will be.  
Definitely start by reading the documentation and loading simple 
elements to familiarize yourself with iBatis.  Anyway, iBatis handles 
this sort of thing cleanly.

Diran

Poitras Christian wrote:

> My first suggestion to you is to read the manuals available in the 
> iBatis download section.
> There is a good tutorial for starting users of iBatis.
> Larry Meadors gave an example in the java user message thread 1757.
>  
> I made a program that does something like what you want. But it is far 
> to big to include it in an email.
> The steps are as following.
> 1) Create a class containing file information.
> 2) You can add a configuration file (dao.xml) for simplicity.
> 3) In this case, define a Dao interface for your class. (containg a 
> public void insert(List yourClassList); method)
> 4) Add a yourclass.xml file containg an insert tag with, possibly an 
> iterate tag nested in it (for speed pupose).
> 5) Add a SqlMapDao class implementing the Dao interface created.
> 6) Add a sql-map-config.xml file.
> 7) Initialize the Dao.
> 8) Make a class that reads the file and parses it in the 
> class. It will make a call to the Dao interface insert method.
>  
>  
> Maybe there is an easy way to copie a file direclty into a table with 
> iBatis, but I never saw such a thing myself.
>  
>  
> If you still have questions about how to use the framework, I will try 
> to help you.
>  
>  
> Christian Poitras
> Institut de recherches cliniques de Montréal (IRCM)
> Christian.Poitras@ircm.qc.ca
>  


Mime
View raw message