Bugs item #983945, was opened at 2004-07-02 10:57
Message generated for change (Comment added) made by radl01
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=983945&group_id=22866
Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: radl (radl01)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: CMP and Sybase JConnect (Short field)
Initial Comment:
I had a problem with Short CMP fields with JConnect
JDBC driver for ASE/ASA. JConnect does not support
setObject() method with Short Object type.
I had to change a source code
(org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil) in
setParameter method a litle bit: I added one more case
Code:
case Types.SMALLINT: // due to setObject
problem with JConnect
if (value instanceof Short) {
ps.setShort(index,
((Short)value).shortValue());
} else {
ps.setObject(index, value, jdbcType);
}
break;
Jan
----------------------------------------------------------------------
>Comment By: radl (radl01)
Date: 2004-07-02 13:19
Message:
Logged In: YES
user_id=1075502
OK. I agree but the problem is only setParametr. There is no
problem in reading results.I can help you if you tell me how.
The problem is that there is no other suitable JDBC drivers
for ASE or ASA db.
Jan
----------------------------------------------------------------------
Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-07-02 12:31
Message:
Logged In: YES
user_id=543482
Yes, try something other than SMALLINT.
<mapping>
<java-type>java.lang.Short</java-type>
<jdbc-type>SMALLINT</jdbc-type>
<sql-type>SMALLINT</sql-type>
</mapping>
Putting in vendor-specific hacks is a bad habit and should
be avoided if possible. If there already are hacks for
JConnect then think about its quality.
I don't mind having vendor specific extensions specifically
in setting parameters and reading results to workaround
their bugs but I have other priorities. If someone wants to
help we can discuss it.
----------------------------------------------------------------------
Comment By: radl (radl01)
Date: 2004-07-02 12:11
Message:
Logged In: YES
user_id=1075502
I do not understand. How can I use defferent mappings when
my CMP fields are Short ? You mean to set Integer mapping to
my Short CMP fields ?
Is it a problem to change JDBCUtil class ? I see that you
have already change this class due to JConnect bugs.
Jan
----------------------------------------------------------------------
Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-07-02 11:38
Message:
Logged In: YES
user_id=543482
Actually, if you can't set Short parameter using this method
then it's a bug in JConnect as it does not implement the
JDBC spec. Try different sql/jdbc mappings.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=983945&group_id=22866
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development