Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

encoding problem

Status
Not open for further replies.

tvrtko

Programmer
Nov 26, 2003
53
HR
I use connection pooling with Tomcat 5.5.4. Entry in server.xml looks like this:

<Context path="/myApp" docBase="myApp" debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="user" password="java" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/instrukcije?autoReconnect=true" />
</Context>

Everything works fine, just I don't know how to specify which character set is to be used for retrieving data from database (I'm getting some strange symbols when I try to retrieve text data containing some central-european characters).

When connecting to database from application without connection poll, character set can be specified in database url somehow like this:

url = jdbc:mysql://localhost:3306/instrukcije?username=user&password=java&useUnicode=true&characterEncoding=charset

But that won't work in case of connection pooling mentioned above.

How to do the similar thing in case of connection pooling mentioned above?

I'm using Connector/J JDBC driver for MySQL.

Thanks in advance.
tvrdi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top