Vlad Ali wrote:

hi all again!

i read docs on coocoon.org & cocoon.wiki but i hasn't found answer on may
question
I need to set two properties for my jdbc connection (for xsp page) (mySQL
driver)
useUnicode = true;
characterEncoding = Cp866

if i use <xsp:logic>...
                           connInfo.put("useUnicode","true");
                           connInfo.put("characterEncoding","Cp866");
         con = DriverManager.getConnection(url);
                          ...
then all work as need, but i think that is not good way because i don't have
pool coonnection controling cocoon..
and i think that best way is set this props in cocoon conf (may be
cocoon.xconf?)
if i write in cocoon.xconf
 <jdbc name="mytest">
     <pool-controller max="10" min="5"/>
     <dburl>jdbc:mysql://localhost:3306/test</dburl>
     <user>dummy</user>
     <useUnicode>true</useUnicode>
     <characterEncoding>Cp866</characterEncoding>
it don't work

Have you any suggestion to help me?



Read the mysql connector/j docs - you append parameters like this to the jdbc "url" (other jdbc connectors do this too). Try this in cocoon.xconf:


<jdbc name="mytest">
     <pool-controller max="10" min="5"/>
     
<dburl>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=Cp866</dburl>
     <user>dummy</user>
</jdbc>

The &amp; is only necessary because of the xml format of jdbc. When the parser reads it and hands it to Cocoon (and therefore the driver) it will just be a good old "&" character.

Geoff

----- Original Message -----
From: "Antonio Gallardo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 5:19 AM
Subject: Re: How to set properties for jdbc connection




Hi Vlad:

Vlad Ali dijo:


I need to set properties for database connection
in java code i write:

  Properties connInfo = new Properties();
  connInfo.put("useUnicode","true");
  connInfo.put("characterEncoding","Cp1251");
  con = DriverManager.getConnection(url, connInfo);

but i don't know how to do same in cocoon configuration


See this doc:
http://wiki.cocoondev.org/Wiki.jsp?page=DatabaseConnectionOverview

Best Regards,

Antonio Gallardo




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to