If you say default mapping I suppose you mean the one in
jboss-3.2.2/server/default/conf/standardjbosscmp-jdbc.xml, right?
Well I also had problems with the default mappings for timestamp/datetime. None of the
listed mappings worked for me.
However, what worked for me is:
JAVA Sql type: TIMESTAMP
Vendor type: datetime (in Mysql)
CMP field: java.sql.Timestamp
which was arranged by my IDE.
If i'm correct this mapping is not in
jboss-3.2.2/server/default/conf/standardjbosscmp-jdbc.xml. This one only contains:
| java.sql.Timestamp
| TIMESTAMP
| TIMESTAMP
|
|
|
| java.util.Date
| TIMESTAMP
| DATETIME
|
|
|
| java.sql.Date
| DATE
| DATETIME
|
|
| java.sql.Time
| TIME
| TIME
|
|
|
| As far as BLOBs are concerned, in file
jboss-3.2.2/server/default/conf/standardjbosscmp-jdbc.xml you have the mapping
|
|
| | java.lang.Object
| | BLOB
| | LONGBLOB
| |
| |
|
| This one doesn't work for me. JBuilderX makes a scheme from the DB as follows:
|
| JAVA Sql type: VARBINARY
| Vendor type: blob (in Mysql)
| CMP field: byte[]
|
| When I use this it doesn't work either.
|
|
|
| The mapping done by the IDE is based on the driver, which is confirmed by the
"MysqlDefs" class from Mark Matthew's driver (the official one now):
|
|
| Maybe I am misuderstanding something fundamentally.
|
| Any help would be highly appreciated.
|
| |
| | /*
| |Copyright (C) 2002 MySQL AB
| |
| | This program is free software; you can redistribute it and/or modify
| | it under the terms of the GNU General Public License as published by
| | the Free Software Foundation; either version 2 of the License, or
| | (at your option) any later version.
| |
| | This program is distributed in the hope that it will be useful,
| | but WITHOUT ANY WARRANTY; without even the implied warranty of
| | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| | GNU General Public License for more details.
| |
| | You should have received a copy of the GNU General Public License
| | along with this program; if not, write to the Free Software
| | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| |
| | */
| | package com.mysql.jdbc;
| |
| | import java.sql.Types;
| |
| |
| | /**
| | * MysqlDefs contains many values that are needed for communication
| | * with the MySQL server.
| | *
| | * @author Mark Matthews
| | * @version $Id: MysqlDefs.java,v 1.6.2.4 2003/03/10 13:02:48 mmatthew Exp $
| | */
| | final class MysqlDefs {
| | //
| | // Constants defined from mysql
| | //
| | // DB Operations
| | static final int SLEEP = 0;
| | static final int QUIT = 1;
| | static final int INIT_DB = 2;
| | static final int QUERY = 3;
| | static final int FIELD_LIST = 4;
| | static final int CREATE_DB = 5;
| | static final int DROP_DB = 6;
| | static final int RELOAD = 7;
| | static final int SHUTDOWN = 8;
| | static final int STATISTICS = 9;
| | static final int PROCESS_INFO = 10;
| | static final int CONNECT = 11;
| | static final int PROCESS_KILL = 12;
| | static final int DEBUG = 13;
| | static final int PING = 14;
| | static final int TIME = 15;
| | static final int DELAYED_INSERT = 16;
| | static final int CHANGE_USER = 17;
| | static final int COM_BINLOG_DUMP = 18;
| | static final int COM_TABLE_DUMP = 19;
| | static final int COM_CONNECT_OUT = 20;
| | static final int COM_REGISTER_SLAVE = 21;
| | static final int COM_PREPARE = 22;
| | static final int COM_EXECUTE = 23;
| | static final int COM_LONG_DATA = 24;
| |
| | // Data Types
| | static final int FIELD_TYPE_DECIMAL = 0;
| | static final int FIELD_TYPE_TINY = 1;
| | static final int FIELD_TYPE_SHORT = 2;
| | static final int FIELD_TYPE_LONG = 3;
| | static final int FIELD_TYPE_FLOAT = 4;
| | static final int FIELD_TYPE_DOUBLE = 5;
| | static final int FIELD_TYPE_NULL = 6;
| | static final int FIELD_TYPE_TIMESTAMP = 7;
| | static final int FIELD_TYPE_LONGLONG = 8;
| | static final int FIELD_TYPE_INT24 = 9;
| | static final int FIELD_TYPE_DATE = 10;
| | static final int FIELD_TYPE_TIME = 11;
| | static final int F