Try just inserting the dates as strings, mysql should understand that
they are dates as long as they look like yyyyxmmxdd where X is some
non-numeric character like - or / so get rid of the { d } part, the JDBC
isn't handling it properly but there should be no need for it.
Bob Garvey wrote:
>
> Can someone point me to the mailing list that is more targeted to JDBC?
> Here is my problem:
> <Environment:>
> <OS Server>
> Linux;Kernel 2.2.12-20 on an i586
> <MySql Server>
> TCX Datakonsult AB, by Monty
> Server version 3.22.32
> Protocol version 10
> <Workstation>
> jdk1.2.2,
> NT4.0 sp6a,
> jdbc driver: mm.mysql.jdbc-2.0pre5
>
> When done through JDBC:
> insert into NAMD values ( 106, soundex('Adame'), 'Adame, G, ', {d
> '1947-06-05'}, 'M', '391-82-1573', {d '2000-04-16'}, {d '2000-04-16'}, {d
> '2000-04-16'}, 'HCPLOADER' )
> Had some problem.
>
> Error during query: Unexpected Exception: java.sql.SQLException message
> given: Syntax error or access violation: You have an error in your SQL
> syntax near '1947-06-05'', 'M', '391-82-1573', ''2000-04-16'',
> ''2000-04-16'', ''2000-04-16''' at line 1
>
> java.sql.SQLException: Error during query: Unexpected Exception:
> java.sql.SQLException message given: Syntax error or access violation: You
> have an error in your SQL syntax near '1947-06-05'', 'M', '391-82-1573',
> ''2000-04-16'', ''2000-04-16'', ''2000-04-16''' at line 1
> at org.gjt.mm.mysql.Connection.execSQL(Connection.java)
> at org.gjt.mm.mysql.Connection.execSQL(Connection.java)
> at org.gjt.mm.mysql.Statement.executeQuery(Statement.java)
> at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78)
> at com.wordgraph.namfam.LoaderModel.main(LoaderModel.java:134)
>
> Through mysql:
> mysql> insert into NAMD values ( 105, soundex('Adame'), 'Adame, G, ', {d
> '1947-0
> 6-05'}, 'M', '391-82-1573', {d '2000-04-16'}, {d '2000-04-16'}, {d
> '2000-04-16'}
> , 'HCPLOADER' );
> Query OK, 1 row affected (0.00 sec)
>
> mysql> desc NAMD;
> +-----------+-------------+------+-----+------------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +-----------+-------------+------+-----+------------+-------+
> | NAMDID | bigint(15) | | PRI | 0 | |
> | SOUNDEX | varchar(6) | | MUL | | |
> | NAME | varchar(60) | | | | |
> | BIRTHDATE | date | YES | | NULL | |
> | GENDER | char(2) | YES | | NULL | |
> | SSN | varchar(12) | YES | | NULL | |
> | EFFDATE | date | | | 0000-00-00 | |
> | ENDDATE | date | | | 0000-00-00 | |
> | MODDATE | date | YES | | NULL | |
> | USERID | varchar(10) | YES | | NULL | |
> +-----------+-------------+------+-----+------------+-------+
> 10 rows in set (0.00 sec)
>
> The table is empty.
>
> Can someone point me.
>
> Bob Garvey
>
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread34634@stripped
>
> To unsubscribe, send a message to:
> <mysql-unsubscribe-steve=rubysolutions.com@stripped>