ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject Re: I want to upload a file into the table in the mysql database.
Date Fri, 31 Mar 2006 16:28:36 GMT
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