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 Zhong Nanhai <hi...@gmail.com> on 2010/05/21 09:17:08 UTC

list all databases in mysql server

Hi,

Is it possible to show all databases in a mysql server with iBatis?



Best Regards,
Zhong Nanhai

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: list all databases in mysql server

Posted by Zhong Nanhai <hi...@gmail.com>.
Many thanks!!! It works.

On 5/21/10, Martin Ellis <ma...@ellis.name> wrote:
> On 21 May 2010 08:17, Zhong Nanhai <hi...@gmail.com> wrote:
>> Is it possible to show all databases in a mysql server with iBatis?
>
> <select id="showdatabases" resultType="map">
>   SHOW DATABASES
> </select>
>
> System.out.println(session.selectList("your-namespace.showdatabases"));
>
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: list all databases in mysql server

Posted by Martin Ellis <ma...@ellis.name>.
On 21 May 2010 08:17, Zhong Nanhai <hi...@gmail.com> wrote:
> Is it possible to show all databases in a mysql server with iBatis?

<select id="showdatabases" resultType="map">
  SHOW DATABASES
</select>

System.out.println(session.selectList("your-namespace.showdatabases"));

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: list all databases in mysql server

Posted by Zhong Nanhai <hi...@gmail.com>.
Hi,

Then, is there any other way?


On 5/21/10, Josh Kamau <jo...@gmail.com> wrote:
> IMHO opinion, its not possible because each connection is to one Database.
> So your ibatis, JDBC or whatever code only knows the objects under the
> database for which connection was made.
>
> Regards.
>
> On Fri, May 21, 2010 at 10:17 AM, Zhong Nanhai
> <hi...@gmail.com>wrote:
>
>> Hi,
>>
>> Is it possible to show all databases in a mysql server with iBatis?
>>
>>
>>
>> Best Regards,
>> Zhong Nanhai
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: list all databases in mysql server

Posted by Josh Kamau <jo...@gmail.com>.
IMHO opinion, its not possible because each connection is to one Database.
So your ibatis, JDBC or whatever code only knows the objects under the
database for which connection was made.

Regards.

On Fri, May 21, 2010 at 10:17 AM, Zhong Nanhai <hi...@gmail.com>wrote:

> Hi,
>
> Is it possible to show all databases in a mysql server with iBatis?
>
>
>
> Best Regards,
> Zhong Nanhai
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>