openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DonBrady <>
Subject RE: Trimming Strings from Database Query Results
Date Wed, 01 Nov 2006 01:10:16 GMT


 Thank you so very much!

 I should have been able to figure that out myself I know.  I was headed in
the right direction but too slowly.

 I have now also added an override for getChar:

package com.x;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.jdbc.sql.DB2Dictionary;

public class ExtendedDB2Dictionary extends
		org.apache.openjpa.jdbc.sql.DB2Dictionary {

	public String getString(ResultSet rs, int col) throws SQLException {
		String str = super.getString(rs, col);
		if (str != null)
			str = str.trim();
		return str;

	public char getChar(ResultSet rs, int col) throws SQLException {

		char c = super.getChar(rs, col);
		if (c == 0)
			c = ' ';
		// make more TopLink compatible
		return c;


View this message in context:
Sent from the open-jpa-dev mailing list archive at

View raw message