You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by go...@osmosis.gr on 2003/10/17 16:02:41 UTC

MySQL encoding problems with connector/J not throug ODBC

hi people 

i have (as many other people here)  encoding problems with greek language 

i have a mysql dadabase runing on winXP with greek content

i try a very simple query using cocoon 2.1 using two different connection 
methods

1. using MySQLConnector/j (3.0)
2. using ODBC connection


in case [1] i dont get greek characters
in case [2] i get greek characters corectly but is not the way i want 
because in production mysql and cocoon will be in a linux box ?

in my simple example i just execute a .xsp and a xml serialization

i have try the simplest query:

			<esql:connection>
				<esql:pool>talanto_work</esql:pool>
				<esql:execute-query>
					<esql:query>select * from contact</esql:query>
					<esql:results>
						<customers>
							<esql:row-results>
								<customer>
									<esql:get-columns/>
								</customer>
							</esql:row-results>
						</customers>
					</esql:results>
				</esql:execute-query>
			</esql:connection>



any idea ?


thnx 
--stavros


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


[SOLUTION] RE: MySQL encoding problems with connector/J not throug ODBC

Posted by go...@osmosis.gr.
thnx to all of you

finaly i have try to insert greek content in MySQL using connect/j

i write down all the step i have to do

cocoon.xconf
<dburl>jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEncoding=ISO-8859-7</dburl>

sitemap.xmap
in actions:
<map:action name="set-encoding" src="org.apache.cocoon.acting.SetCharacterEncodingAction"/>

in pipeline:
			<map:act type="set-encoding">
				<map:parameter name="form-encoding" value="UTF-8"/>
			</map:act>

the action in site map help me to post greek text from html forms to .xsp 
where the data are appended to mysql


--stavros


On Fri, 17 Oct 2003 gounis@osmosis.gr wrote:

> 
> for example 
> 
> in UTF case te url will be like this ? :
> 
> 
> jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEncoding=UTF-8
> 
> 
> 
> On Fri, 17 Oct 2003, Mark H wrote:
> 
> > Came across a similar problem a while back. The solution was to add
> > parameters to the database url, setting the character encoding to the one
> > that java uses.
> > 
> > in WEB-INF/cocoon.xconf:
> > 
> > <datasources>
> >     <jdbc name="databaseName" logger="core.datasources.databaseName">
> >       <pool-controller min="5" max="10"/>
> > 
> > <dburl>jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEnco
> > ding=Cp1252</dburl>
> >       <user>username</user>
> >       <password>password</password>
> >     </jdbc>
> >  </datasources>
> > 
> > Mark
> > 
> > > -----Original Message-----
> > > From: users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> > > [mailto:users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> > > ]On Behalf Of leo leonid
> > > Sent: 17 October 2003 15:20
> > > To: users@cocoon.apache.org
> > > Subject: Re: MySQL encoding problems with connector/J not throug ODBC
> > >
> > >
> > >
> > > What encoding do you use in your DB? I solved all my encoding problems
> > > when I changed the encoding of my DB to UNICODE. (But I don't know if
> > > this possible in MySQL now. I migrated to PostgreSQL for this reason, a
> > > long time ago)
> > >
> > > /leo
> > >
> > > On Oct 17, 2003, at 4:02 PM, gounis@osmosis.gr wrote:
> > >
> > > >
> > > > hi people
> > > >
> > > > i have (as many other people here)  encoding problems with greek
> > > > language
> > > >
> > > > i have a mysql dadabase runing on winXP with greek content
> > > >
> > > > i try a very simple query using cocoon 2.1 using two different
> > > > connection
> > > > methods
> > > >
> > > > 1. using MySQLConnector/j (3.0)
> > > > 2. using ODBC connection
> > > >
> > > >
> > > > in case [1] i dont get greek characters
> > > > in case [2] i get greek characters corectly but is not the way i want
> > > > because in production mysql and cocoon will be in a linux box ?
> > > >
> > > > in my simple example i just execute a .xsp and a xml serialization
> > > >
> > > > i have try the simplest query:
> > > >
> > > > 			<esql:connection>
> > > > 				<esql:pool>talanto_work</esql:pool>
> > > > 				<esql:execute-query>
> > > > 					<esql:query>select * from
> > > contact</esql:query>
> > > > 					<esql:results>
> > > > 						<customers>
> > > > 							<esql:row-results>
> > > > 								<customer>
> > > >
> > > <esql:get-columns/>
> > > > 								</customer>
> > > > 							</esql:row-results>
> > > > 						</customers>
> > > > 					</esql:results>
> > > > 				</esql:execute-query>
> > > > 			</esql:connection>
> > > >
> > > >
> > > >
> > > > any idea ?
> > > >
> > > >
> > > > thnx
> > > > --stavros
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: MySQL encoding problems with connector/J not throug ODBC

Posted by go...@osmosis.gr.
for example 

in UTF case te url will be like this ? :


jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEncoding=UTF-8



On Fri, 17 Oct 2003, Mark H wrote:

> Came across a similar problem a while back. The solution was to add
> parameters to the database url, setting the character encoding to the one
> that java uses.
> 
> in WEB-INF/cocoon.xconf:
> 
> <datasources>
>     <jdbc name="databaseName" logger="core.datasources.databaseName">
>       <pool-controller min="5" max="10"/>
> 
> <dburl>jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEnco
> ding=Cp1252</dburl>
>       <user>username</user>
>       <password>password</password>
>     </jdbc>
>  </datasources>
> 
> Mark
> 
> > -----Original Message-----
> > From: users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> > [mailto:users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> > ]On Behalf Of leo leonid
> > Sent: 17 October 2003 15:20
> > To: users@cocoon.apache.org
> > Subject: Re: MySQL encoding problems with connector/J not throug ODBC
> >
> >
> >
> > What encoding do you use in your DB? I solved all my encoding problems
> > when I changed the encoding of my DB to UNICODE. (But I don't know if
> > this possible in MySQL now. I migrated to PostgreSQL for this reason, a
> > long time ago)
> >
> > /leo
> >
> > On Oct 17, 2003, at 4:02 PM, gounis@osmosis.gr wrote:
> >
> > >
> > > hi people
> > >
> > > i have (as many other people here)  encoding problems with greek
> > > language
> > >
> > > i have a mysql dadabase runing on winXP with greek content
> > >
> > > i try a very simple query using cocoon 2.1 using two different
> > > connection
> > > methods
> > >
> > > 1. using MySQLConnector/j (3.0)
> > > 2. using ODBC connection
> > >
> > >
> > > in case [1] i dont get greek characters
> > > in case [2] i get greek characters corectly but is not the way i want
> > > because in production mysql and cocoon will be in a linux box ?
> > >
> > > in my simple example i just execute a .xsp and a xml serialization
> > >
> > > i have try the simplest query:
> > >
> > > 			<esql:connection>
> > > 				<esql:pool>talanto_work</esql:pool>
> > > 				<esql:execute-query>
> > > 					<esql:query>select * from
> > contact</esql:query>
> > > 					<esql:results>
> > > 						<customers>
> > > 							<esql:row-results>
> > > 								<customer>
> > >
> > <esql:get-columns/>
> > > 								</customer>
> > > 							</esql:row-results>
> > > 						</customers>
> > > 					</esql:results>
> > > 				</esql:execute-query>
> > > 			</esql:connection>
> > >
> > >
> > >
> > > any idea ?
> > >
> > >
> > > thnx
> > > --stavros
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: MySQL encoding problems with connector/J not throug ODBC

Posted by Mark H <ma...@markhorgan.com>.
Came across a similar problem a while back. The solution was to add
parameters to the database url, setting the character encoding to the one
that java uses.

in WEB-INF/cocoon.xconf:

<datasources>
    <jdbc name="databaseName" logger="core.datasources.databaseName">
      <pool-controller min="5" max="10"/>

<dburl>jdbc:mysql://localhost/databaseName?useUnicode=true&amp;characterEnco
ding=Cp1252</dburl>
      <user>username</user>
      <password>password</password>
    </jdbc>
 </datasources>

Mark

> -----Original Message-----
> From: users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> [mailto:users-return-56783-mailinglists=markhorgan.com@cocoon.apache.org
> ]On Behalf Of leo leonid
> Sent: 17 October 2003 15:20
> To: users@cocoon.apache.org
> Subject: Re: MySQL encoding problems with connector/J not throug ODBC
>
>
>
> What encoding do you use in your DB? I solved all my encoding problems
> when I changed the encoding of my DB to UNICODE. (But I don't know if
> this possible in MySQL now. I migrated to PostgreSQL for this reason, a
> long time ago)
>
> /leo
>
> On Oct 17, 2003, at 4:02 PM, gounis@osmosis.gr wrote:
>
> >
> > hi people
> >
> > i have (as many other people here)  encoding problems with greek
> > language
> >
> > i have a mysql dadabase runing on winXP with greek content
> >
> > i try a very simple query using cocoon 2.1 using two different
> > connection
> > methods
> >
> > 1. using MySQLConnector/j (3.0)
> > 2. using ODBC connection
> >
> >
> > in case [1] i dont get greek characters
> > in case [2] i get greek characters corectly but is not the way i want
> > because in production mysql and cocoon will be in a linux box ?
> >
> > in my simple example i just execute a .xsp and a xml serialization
> >
> > i have try the simplest query:
> >
> > 			<esql:connection>
> > 				<esql:pool>talanto_work</esql:pool>
> > 				<esql:execute-query>
> > 					<esql:query>select * from
> contact</esql:query>
> > 					<esql:results>
> > 						<customers>
> > 							<esql:row-results>
> > 								<customer>
> >
> <esql:get-columns/>
> > 								</customer>
> > 							</esql:row-results>
> > 						</customers>
> > 					</esql:results>
> > 				</esql:execute-query>
> > 			</esql:connection>
> >
> >
> >
> > any idea ?
> >
> >
> > thnx
> > --stavros
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: MySQL encoding problems with connector/J not throug ODBC

Posted by leo leonid <te...@leonid.de>.
What encoding do you use in your DB? I solved all my encoding problems 
when I changed the encoding of my DB to UNICODE. (But I don't know if 
this possible in MySQL now. I migrated to PostgreSQL for this reason, a 
long time ago)

/leo

On Oct 17, 2003, at 4:02 PM, gounis@osmosis.gr wrote:

>
> hi people
>
> i have (as many other people here)  encoding problems with greek 
> language
>
> i have a mysql dadabase runing on winXP with greek content
>
> i try a very simple query using cocoon 2.1 using two different 
> connection
> methods
>
> 1. using MySQLConnector/j (3.0)
> 2. using ODBC connection
>
>
> in case [1] i dont get greek characters
> in case [2] i get greek characters corectly but is not the way i want
> because in production mysql and cocoon will be in a linux box ?
>
> in my simple example i just execute a .xsp and a xml serialization
>
> i have try the simplest query:
>
> 			<esql:connection>
> 				<esql:pool>talanto_work</esql:pool>
> 				<esql:execute-query>
> 					<esql:query>select * from contact</esql:query>
> 					<esql:results>
> 						<customers>
> 							<esql:row-results>
> 								<customer>
> 									<esql:get-columns/>
> 								</customer>
> 							</esql:row-results>
> 						</customers>
> 					</esql:results>
> 				</esql:execute-query>
> 			</esql:connection>
>
>
>
> any idea ?
>
>
> thnx
> --stavros
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org