OK, A few days ago I reported a problem with getImportedKeys, since nobody came with a solution that would work, I did some research, downloaded the code for the driver (I actually downloaded the code for Alpha, since I wanted to report the bug, if there was one as accurately as possible). As far as I can tell, it is a bug. I hope one of the developers is reading this list and can respond directly as to how to proceed with this, or if anyone knows where to post this, please let me know.
In line 4926 of DatabaseMetaData.java, the code is looking for a line starting with "FOREIGN KEY". The problem seems to be that the version of mysql I have (mysql --version gives me 'mysql Ver 12.20 Distrib 4.0.13, for pc-linux (i686)') Returns the following when you do a show create table: mysql> show Create Table Template CREATE TABLE `Template` ( `template_ID` int(11) NOT NULL auto_increment, `foreign_Key_ID` int(11) NOT NULL default '0', `string_Field` varchar(255) default NULL, `date_Field` timestamp(14) NOT NULL, `boolean_Field` tinyint(4) default NULL, `double_Field` double default NULL, `decimal_Field` decimal(10,0) default NULL, PRIMARY KEY (`template_ID`), KEY `fkid_ind` (`foreign_Key_ID`), CONSTRAINT `0_45` FOREIGN KEY (`foreign_Key_ID`) REFERENCES `ForeignTable` (`foreign_ID`) ) TYPE=InnoDB If you pay a little attention, the line with the foreign key happens to have the name of the constraint as well as the word FOREIGN KEY. This of course, breaks the algorithm. Perhaps something along the lines of line.substring may work better than line.startsWith? Thank you very much! Roberto Leibman P.S. Here are the versions of software I use mysql: mysql Ver 12.20 Distrib 4.0.13, for pc-linux (i686) java: Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06) Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode) mysql connector: mysql-connector-java-3.1.0-alpha-bin.jar
signature.asc
Description: This is a digitally signed message part