-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Thu Dec 08, 2005 10:45 am 
Newbie

Joined: Wed Jul 27, 2005 11:20 am
Posts: 19
steckemetz wrote:
@dngo:
We intend to use DB2400 too.
Is the schema separator different just for
"select identity_val_local() from sysibm.sysdummy1"
or for all SQLs ?

It's different for all SQLs.

_________________
Don Ngo


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 4:06 pm 
Newbie

Joined: Wed Jul 27, 2005 11:20 am
Posts: 19
steve wrote:
I did make a change for rc3 relating to how PreparedStatements are built to utilize getGeneratedKeys.

We switched from http://java.sun.com/j2se/1.4.2/docs/api ... ang.String, int) to http://java.sun.com/j2se/1.4.2/docs/api ... ang.String, java.lang.String[])

So it sounds more like an issue of the JDBC driver not fully supporting getGeneratedKeys even though it reports to do so.

Now I know exactly what you're talking here. The AS/400 DB2 JDBC Driver does not fully supported all overloaded version of prepareStatement() as gavin has stated earlier. Below is the code fragment from the driver source:

Code:
public class AS400JDBCConnection
implements Connection
{
...
    /**
     * Precompiles an SQL statement with optional input parameters
     * and stores it in a PreparedStatement object.  This object can
     * be used to efficiently execute this SQL statement
     * multiple times.
     *
     *[b] <p><B>This method is not supported.  An SQLException is always thrown. </B>[/b]
     *
     * @param  sql     The SQL statement.                                 
     * @param  columnNames An array of column names indicating the columns that should be returned from the inserted row or rows.
     * @return         An SQLException is always thrown. This method is not supported.
     * @exception      java.sql.SQLException - Always thrown because the Toolbox JDBC driver does does not support this method.
     * @since Modification 5
    **/
    public PreparedStatement prepareStatement (String sql, String[] columnNames)
    throws SQLException
    {
[b]
        JDError.throwSQLException (this, JDError.EXC_FUNCTION_NOT_SUPPORTED);
        return null;
[/b]
    }
...
}

_________________
Don Ngo


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 4:09 pm 
Newbie

Joined: Wed Jul 27, 2005 11:20 am
Posts: 19
gavin wrote:
Absolutely not.

We are certainly not going to add a new configuration property for the benefit of one user. Hibernate has way, way, way too many switches already.

As much as I hate to say this, I agree with you gavin.

_________________
Don Ngo


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 7:17 pm 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
Hi, just wanted to add that I contacted jtOpen/400's forum (the developers behind the free implementation of IBM's Toolbox / JDBC driver) about this issue, and it looks like that the missing method will be implemented as soon as the server side on the iSeries will support it.

If anyone is interested, the URL is http://jt400.sourceforge.net

So, for the time being, the only way not to break compatibility with Hibernate is to force getGeneratedKeys() disabled even if the driver reports it is supported and to specify "naming=sql" in the url for jdbc.

Besides allowing Hibernate to use its standard syntax for queries (with the '.'), it is just the Good Choice to use "naming=sql" when using JDBC on iSeries. If you want to call RPG or custom iSeries commands you can always use a separate connection from the Toolbox.

Regards,

Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 12:22 pm 
Beginner
Beginner

Joined: Tue Sep 09, 2003 9:11 pm
Posts: 32
gavin wrote:
dngo wrote:
Per Max's earlier note, it would be nice to have means to configure what character to be used as the default schema separator. That way I don't even need to override the DB2400Dialec class just to solve this problem of mine.



You are welcome to try and produce a patch if you like.

Note that it is not as simple as simply rolling back my recent changes, because things like getIdentitySelectString() never used the overridden separator. You would have to track down all the places Hibernate uses '.' for any dialect.

I'm really not sure it is worth the effort.


I opened a JIRA issue and was pointed to this thread. I figure the issue is about to be closed/rejected, just wanted to provide a use case to see if anyone else has interest in this functionality or if I'm only the second/third person who would like to see this.

FYI, the issue is: http://opensource2.atlassian.com/projec ... e/HHH-1385

Chris....

_________________
___________
Chris....
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 12:43 pm 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
That's a good idea, Chris;

Remember though that it's IBM's JDBC driver for DB2/400 that's broken, not Hibernate...

If you're interested in the matter you should periodically check new version of the open source counterpart of the Toolbox, http://jt400.sourceforge.net.


Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 10, 2006 11:06 am 
Senior
Senior

Joined: Tue Aug 03, 2004 2:11 pm
Posts: 142
Location: Somerset
giulio.vezzelli wrote:
That's a good idea, Chris;

Remember though that it's IBM's JDBC driver for DB2/400 that's broken, not Hibernate...

If you're interested in the matter you should periodically check new version of the open source counterpart of the Toolbox, http://jt400.sourceforge.net.


Giulio


Having encountered this problem as well, I have raised the issue on the JTOPEN support forum:

http://www-912.ibm.com/j_dir/JTOpen.nsf ... enDocument

_________________
On the information super B road


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.