User: mulder  
  Date: 00/10/20 19:28:02

  Modified:    src/main/org/jboss/ejb/plugins/jaws/jdbc JDBCCommand.java
  Log:
  Add extra primitive handling for drivers that don't natively support
  certain primitives (usually byte or short).  Otherwise, when
  deserialized we see that byte != java.lang.Byte and don't let it through.
  
  Revision  Changes    Path
  1.19      +19 -3     jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommand.java
  
  Index: JDBCCommand.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jaws/jdbc/JDBCCommand.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JDBCCommand.java  2000/10/20 14:08:29     1.18
  +++ JDBCCommand.java  2000/10/21 02:28:02     1.19
  @@ -53,7 +53,7 @@
    * utility methods that database commands may need to call.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Justin Forder</a>
  - * @version $Revision: 1.18 $
  + * @version $Revision: 1.19 $
    */
   public abstract class JDBCCommand
   {
  @@ -419,8 +419,24 @@
                                if (result instanceof Handle) result = 
((Handle)result).getEJBObject();
   
                   if(!destination.isAssignableFrom(result.getClass())) {
  -                    log.debug("Unable to load a ResultSet column into a variable of 
type '"+destination.getName()+"' (got a "+result.getClass().getName()+")");
  -                    result = null;
  +                    boolean found = false;
  +                    if(destination.isPrimitive()) {
  +                        if((destination.equals(Byte.TYPE) && result instanceof 
Byte) ||
  +                           (destination.equals(Short.TYPE) && result instanceof 
Short) ||
  +                           (destination.equals(Character.TYPE) && result instanceof 
Character) ||
  +                           (destination.equals(Boolean.TYPE) && result instanceof 
Boolean) ||
  +                           (destination.equals(Integer.TYPE) && result instanceof 
Integer) ||
  +                           (destination.equals(Long.TYPE) && result instanceof 
Long) ||
  +                           (destination.equals(Float.TYPE) && result instanceof 
Float) ||
  +                           (destination.equals(Double.TYPE) && result instanceof 
Double)
  +                          ) {
  +                            found = true;
  +                        }
  +                    }
  +                    if(!found) {
  +                        log.debug("Unable to load a ResultSet column into a 
variable of type '"+destination.getName()+"' (got a "+result.getClass().getName()+")");
  +                        result = null;
  +                    }
                   }
   
                   ois.close();
  
  
  

Reply via email to