[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-1479) Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400
Steve Ebersole (JIRA)
noreply at atlassian.com
Tue May 8 22:10:04 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole updated HHH-1479:
--------------------------------
Assignee: Steve Ebersole
This is the case in Hibernate 3.2 releases. Try with 3.2.3 and see if you still have this problem. You should not.
> Incompatibility of Hibernate 3.1 and JTOpen JDBC drivers for IBM AS/400
> -----------------------------------------------------------------------
>
> Key: HHH-1479
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1479
> Project: Hibernate3
> Issue Type: Patch
> Affects Versions: 3.1
> Environment: Hibernate 3.1
> JDBC driver: JTOpen (for IBM AS/400) http://jt400.sourceforge.net
> Reporter: Davide Rogora
> Assignee: Steve Ebersole
>
> Hello,
> I've noticed that from version 3.1 Hibernate, when calling JDBC driver for INSERT statement, uses the following prepareStatement method:
> prepareStatement(String sql, String[] columnNames)
> instead of the following
> prepareStatement(String sql, int autoGeneratedKeys)
> used since versione 3.0.x
> the problem is that JDBC driver for AS/400 (project JTOpen on sourceforge: http://jt400.sourceforge.net) doesn't support the method prepareStatement(String sql, String[] columnNames) so it's not possible to use Hibernate 3.1 with AS/400
> I've also noticed that other open source drivers that support this method (for example MySQL Jdbcconnector or JTDS for Ms-SQLServer) have implemented it using a workaround; infact they call the "old" prepareStatement(String sql, int autoGeneratedKeys) method ignoring the content of the columnNames array.
> Here is the source of the jtds implementation:
> -------------------------------------------------------------------------------
> public PreparedStatement prepareStatement(String sql, String[] columnNames)
> throws SQLException {
> if (columnNames == null) {
> throw new SQLException(
> Messages.get("error.generic.nullparam", "prepareStatement"),"HY092");
> } else if (columnNames.length != 1) {
> throw new SQLException(
> Messages.get("error.generic.needcolname", "prepareStatement"),"HY092");
> }
> return prepareStatement(sql, JtdsStatement.RETURN_GENERATED_KEYS);
> }
> -------------------------------------------------------------------------------
> So I'm asking to the Hibernate team if it's possible to use the old method prepareStatement(String sql, int autoGeneratedKeys) in the future releases of Hibernate.
> Thanks,
> Davide Rogora.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list