MySQL INSERT失败

时间:2012-07-05 15:15:45

标签: mysql derby

我的代码是

connect 'jdbc:derby:sampleclient';
    set schema SYMMETRIC;
    insert into "sale_transaction" ("tran_id", "store", "workstation", "day", "seq") values (1000, '1', '3', '2007-11-01', 100);
    insert into "sale_return_line_item"("tran_id", "item_id"," price", "quantity") values (1000, 110000055, 0.65, 1); 
    select * from "sale_transaction";
    select * from "sale_return_line_item";

我试图从德比中将数据插入到mysql中,即im复制数据,但是当我输入下面的命令时我得到的错误如下所示,而push-derby2mysql是包含代码的文件

 C:\symmetric-ds-3.0.1-server\symmetric-ds-3.0.1\samples>sh ij.sh push-derby2my
    l.sql
    ij version 10.5
    ij> connect 'jdbc:derby:sampleclient';
    ij> set schema SYMMETRIC;
    0 rows inserted/updated/deleted
    ij> insert into "sale_transaction" ("tran_id", "store", "workstation", "day",
    eq") values (1000, '1', '3', '2007-11-01', 100);
    ERROR 42X51: The class 'org.jumpmind.symmetric.db.derby.DerbyFunctions' does n
     exist or is inaccessible. This can happen if the class is not public.
    ERROR XJ001: Java exception: 'org.jumpmind.symmetric.db.derby.DerbyFunctions:
    va.lang.ClassNotFoundException'.
    ij> insert into "sale_return_line_item"("tran_id", "item_id"," price", "quanti
    ") values (1000, 110000055, 0.65, 1);
    ERROR 42X14: ' price' is not a column in table or VTI 'SYMMETRIC.sale_return_l
    e_item'.
    ij> select * from "sale_transaction";
    tran_id    |store|wo&|day       |seq
    --------------------------------------------

    0 rows selected
    ij> select * from "sale_return_line_item";
    tran_id    |item_id    |price       |quantity   |returned_q&
    ------------------------------------------------------------

1 个答案:

答案 0 :(得分:1)

如果您阅读错误..

  

类'org.jumpmind.symmetric.db.derby.DerbyFunctions'确实存在或无法访问。

这可以防止任何插入发生,因此你的后选择不会得到任何东西。

如错误所示,请检查:

  1. 如果存在对 org.jumpmind.symmetric.db.derby.DerbyFunctions 的引用
  2. 如果 org.jumpmind.symmetric.db.derby.DerbyFunctions 的文件存在(可能是问题)
  3. 如果上课是公开的(可能是的)
  4. 看起来您没有安装SymmetricDS软件包。您可以从here下载。