You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Davy Pulinckx <da...@telenet.be> on 2007/05/31 21:03:47 UTC

Please help me.

Hellow

 

I have a question on how I would change my application in the best possible
way.

I will first explain the situation.

There is a web-application build with JBuiler, I use weblogic to deploy te
application and I uses .xml properties files each different for each
environment (integration, acceptation and production) and the database is
db2

At this time I uses JDBC and the sql query is written in the source file for
example :

 

private final String select1 = "SELECT * FROM "+ javaFile.schemaName +
etc...

 

Now the problem is, the application uses properties files, in the properties
file I store for example the db2 schema, url's, etc.

My question is, how would I made this to ibatis

-          How cane I get the name of the db2 schema stored in the xml
propertie-file into Ibatis xml file sow I cane execute my sql file written
in ibatis => SELECT * FROM "+ javaFile.schemaName + etc...

-          An other problem for me is, the application uses weblogic, in the
console are datasources and connectionpools created. I read many examples
and always I see username and password written in the .xml config file of
ibatis. Butt is there a way to use the weblogic configuration (datasource,
connectionpool).

 

I now I ask mutch, butt I just changed to another employee the application
is written during a few years thru another person, and now I must learn
everything in a few months and I must migrate the application to ibatis in a
few weeks, and I don't now what I must do to make this work, every help is
good, examples, tutorials, etc..

Would you please help me, please.

 

Sorry for my English, I'm Dutch (Europe)  

 

 

Or is there another way to configurate this.

 

 

 


Re: Please help me.

Posted by Nathan Maves <na...@gmail.com>.
Pretty simple actually,

you can pass a string (non binding) variable into a sqlmap

example

<sqlmap ......>
   select * from $schema$.person where id = #id#
</sqlmap>

Note the use of $$ and ##.  The $$ uses a string substitution and not a jdbc
parameter.


On 5/31/07, Davy Pulinckx <da...@telenet.be> wrote:
>
>  Hellow
>
>
>
> I have a question on how I would change my application in the best
> possible way.
>
> I will first explain the situation.
>
> There is a web-application build with JBuiler, I use weblogic to deploy te
> application and I uses .xml properties files each different for each
> environment (integration, acceptation and production) and the database is
> db2
>
> At this time I uses JDBC and the sql query is written in the source file
> for example :
>
>
>
> private final String select1 = "SELECT * FROM "+ javaFile.schemaName +
> etc…..
>
>
>
> Now the problem is, the application uses properties files, in the
> properties file I store for example the db2 schema, url's, etc…
>
> My question is, how would I made this to ibatis
>
> -          How cane I get the name of the db2 schema stored in the xml
> propertie-file into Ibatis xml file sow I cane execute my sql file written
> in ibatis => SELECT * FROM "+ *javaFile.schemaName* + etc…..
>
> -          An other problem for me is, the application uses weblogic, in
> the console are datasources and connectionpools created. I read many
> examples and always I see username and password written in the .xml config
> file of ibatis. Butt is there a way to use the weblogic configuration
> (datasource, connectionpool).
>
>
>
> I now I ask mutch, butt I just changed to another employee the application
> is written during a few years thru another person, and now I must learn
> everything in a few months and I must migrate the application to ibatis in a
> few weeks, and I don't now what I must do to make this work, every help is
> good, examples, tutorials, etc….
>
> Would you please help me, please.
>
>
>
> Sorry for my English, I'm Dutch (Europe)
>
>
>
>
>
> Or is there another way to configurate this.
>
>
>
>
>
>
>