Hello,
 
this part of IBatis is poorly documented, but there is a way.
 
Part of IBatsis.config :
<database>
<provider name="oracle10.2"/>
<dataSource name="X"
connectionString="MW : don't touch - it will be filled in code ( XMapper )"/>
</database>
 
XMapper.cs:
ConfigureHandler handler = new ConfigureHandler(Configure); 
DomSqlMapBuilder builder = new DomSqlMapBuilder();
XmlDocument config = new XmlDocument();
Stream configStream = 
Assembly.GetExecutingAssembly().GetManifestResourceStream("IBatis.config");
XmlReader xmlReader = XmlReader.Create(configStream); 
config.Load(xmlReader);
XmlNode node = config.GetElementsByTagName("dataSource")[0]; // we have only 
one datasource tag there
string connectionString = "abracadabra";
node.Attributes["connectionString"].Value = connectionString;
_mapper = builder.Configure(config); 
 
It works like the standard initialisation described in documentation except you 
may manipulate the configuration xml.
 
--

Mit freundlichen Grüßen / Pozdrawiam
Marcin Wisthal,
Software Developer

Software Solutions Team Sp. z o.o.
ul. Bojkowska 37
44-101 Gliwice
Tel. +48 32 461 20 42

Homepage                    : http://www.sst.pl
Register/Sąd Rejestrowy     : Sąd Rejonowy w Gliwicach, X Wydział Gospodarczy 
KRS
Registernr./KRS             : 0000130970
USt-IdNr./NIP               : 639-18-03-194
Betriebsnummer/Regon        : 277821742
Stammkapital/Kapitał zakł.  : 50.000 zł



________________________________

Od: Andrew P Chan [mailto:[EMAIL PROTECTED]
Wysłano: Pt 2008-11-14 09:26
Do: [email protected]
Temat: Different Oracle User Name.




My system is windows application and currently I am using iBatis SQL Mapper.
The SQL mapper is very powerful and help me reduce a lot of duplicated code.

However, the Oracle server's login and password will store in SQLMAP.config.
My system has a requirement that user will log on the database with their
unique user account.

is it possible to rewrite or are there any easier method to change the
username and password dynamically?

Thank You so much.

ADC
--
View this message in context: 
http://www.nabble.com/Different-Oracle-User-Name.-tp20496484p20496484.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.



<<winmail.dat>>

Reply via email to