Thanks for the reply,

 

The example in the link only seem to give me a normal datareader, though. Is there some way I can plug this into iBatis to create my objects?

 

I’m not yet thoroughly familiar with iBatis, and I’m currently specifying the datasource only in the “sqlMap.config” file. I assume this won’t work if I want to load data from CSV files during run-time, since I don’t have the datasource yet.

 

However, is there some way I can specify a “parameterMap” in the xml file, and then use iBatis to apply that mapping also to an sqlreader?

 

 

I looked at the SqlMapper now, and see there is a DataSource property. Is this what I am supposed to use? I’ll look more into that part, but If you have any links to more information about how I can use other datasources for the mapper, I’d be very happy.

 

 

--

Per Magne

 

 


From: Gilles Bayon [mailto:[EMAIL PROTECTED]
Sent: Friday, July 28, 2006 13:57
To: dev@ibatis.apache.org
Subject: Re: Mapping objects from CSV files. (.Net)

 

A CSV can be see as a relationnal database on which you do sql statement.

You can easily access data in CSV files (Comma-Separated Values) using ADO.NET components.
All you need is to use the Jet engine thanks to a connection string like the following one:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TxtFilesFolder\;Extended Properties='text;HDR=Yes;FMT=Delimited'"

Note: "HDR=Yes" indicates that the first row contains columnnames, not data (source: connectionstrings.com).
Then you use it as as follows :

"SELECT * FROM data.txt"

See more infos in
http://www.dotnet-fr.org/sections.php3?op=viewarticle&artid=59
--
Cheers,
Gilles

Wish List

Reply via email to