Issue Details (XML | Word | Printable)

Key: EQX-63
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: osman izbat
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AppFuse Light

Mysql + IBatis "java.sql.SQLException: Table 'equinox.app_user' doesn't exist" problem

Created: 17/Feb/06 05:57 PM   Updated: 07/Sep/07 10:55 AM   Resolved: 07/Sep/07 10:55 AM
Component/s: DAO Layer
Affects Version/s: 1.4, 1.5
Fix Version/s: 1.8

Environment: WinXP Prof. jdk1.5 tomcat-5.5.15 mysql-5


 Description  « Hide
Hi

I'm trying to use equinox with ibatis dao layer and mysql database but i am having problem:

SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in org/appfuse/dao/ibatis/UserSQL.xml. --- The error occurred while applying a parameter map. --- Check the getUsers-InlineParameterMap. --- Check the statement (query failed). --- Cause: java.sql.SQLException: Table 'equinox.app_user' doesn't exist.

I would like to create tables manualy but there is not an sql script for mysql in src\org\appfuse\dao\ibatis directory.

Please could you help me ?





Matt Raible added a comment - 17/Feb/06 06:18 PM
You could convert the following postgres script to MySQL's syntax and name it create-mysql.sql and it should work:

drop table app_user;
drop sequence user_sequence;

create table app_user (id bigint not null primary key, first_name varchar(50), last_name varchar(50), birthday timestamp);
create sequence user_sequence;

For the first two lines, you can probably drop them and for the 2nd two, use "create table app_user if not exists".

Matt

osman izbat added a comment - 20/Feb/06 03:53 AM
Hello

There is some info on http://wiki.javajigi.net/pages/viewpage.action?pageId=469
I think it chinese but i've found what i am looking for.
I've created equinox db like this:

drop table if exists app_user ;
drop table if exists user_sequence ;

create table app_user (id bigint not null primary key, first_name varchar(50), last_name varchar(50), birthday timestamp);
create table user_sequence (value int not null);
insert into user_sequence values(0);

then i've uncommented
        <property name="columnName"><value>value</value></property>
line in applicationContext-ibatis.xml then it worked .

Thank you very much

Regards.

Matt Raible made changes - 15/May/07 09:50 PM
Field Original Value New Value
Fix Version/s 1.8 [ 10100 ]
Matt Raible added a comment - 07/Sep/07 10:55 AM
MySQL is the default in AL 1.8.

Matt Raible made changes - 07/Sep/07 10:55 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]