How to make mysql as database?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make mysql as database?

Alex Chew
Hi,
I'd like to use mysql for xfroms data storage.Followed the example xforms-sql-address-book, I make some change
1,change create table scriptlets as following in init-address-book.xpl
                        <sql:update>
                            create table orbeon_address_book (
                                id      bigint,
                                first   varchar(255) not null,
                                last    varchar(255) not null,
                                phone   varchar(255) not null
                            )
                        </sql:update>
2,change datasource configuration in datasrouce-sql.xml
    <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
    <uri>jdbc:mysql://localhost:3306/xform</uri>
    <username>xform</username>
    <password>xform</password>
3,put jar file with mysql jdbc driver under WEB-INF\lib directory
 
But it failed to create table or query data or save data when I restart the application.
 
How can I make this work?Thanks in advance.
 
Alex


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to make mysql as database?

Erik Bruchez
Administrator
Alex,

Does init-address-book.xpl run at all? In the SQL Address Book example,
this is called from init-database.xpl, which is called from every
pipeline that performs database operations: service-add.xpl,
service-delete.xpl, service-get.xpl,

If not, does it produce an error?

-Erik

Alex Chew wrote:

> Hi,
> I'd like to use mysql for xfroms data storage.Followed the example
> xforms-sql-address-book, I make some change
> 1,change create table scriptlets as following in init-address-book.xpl
>                         <sql:update>
>                             create table orbeon_address_book (
>                                 id      bigint,
>                                 first   varchar(255) not null,
>                                 last    varchar(255) not null,
>                                 phone   varchar(255) not null
>                             )
>                         </sql:update>
> 2,change datasource configuration in datasrouce-sql.xml
>     <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>     <uri>jdbc:mysql://localhost:3306/xform</uri>
>     <username>xform</username>
>     <password>xform</password>
> 3,put jar file with mysql jdbc driver under WEB-INF\lib directory
>  
> But it failed to create table or query data or save data when I restart
> the application.
>  
> How can I make this work?Thanks in advance.
>  
> Alex
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to make mysql as database?

Alex Chew
Thanks,Erik
I think it runs. There is no init data on the page when i reenter the application.
I didnot get any error message on the page, but "add" operation does nothing.
I even try to add System.out.println("executed") in java file,but fail to get any output.
 
How to get some debug message for further test?
 
Alex
 
On 7/4/07, Erik Bruchez <[hidden email]> wrote:
Alex,

Does init-address-book.xpl run at all? In the SQL Address Book example,
this is called from init-database.xpl, which is called from every
pipeline that performs database operations: service-add.xpl,
service-delete.xpl, service-get.xpl,

If not, does it produce an error?

-Erik

Alex Chew wrote:

> Hi,
> I'd like to use mysql for xfroms data storage.Followed the example
> xforms-sql-address-book, I make some change
> 1,change create table scriptlets as following in init-address-book.xpl
>                         <sql:update>
>                             create table orbeon_address_book (
>                                 id      bigint,
>                                 first   varchar(255) not null,
>                                 last    varchar(255) not null,
>                                 phone   varchar(255) not null
>                             )
>                         </sql:update>
> 2,change datasource configuration in datasrouce-sql.xml
>     <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>     <uri>jdbc:mysql://localhost:3306/xform</uri>
>     <username>xform</username>

>     <password>xform</password>
> 3,put jar file with mysql jdbc driver under WEB-INF\lib directory
>
> But it failed to create table or query data or save data when I restart
> the application.
>
> How can I make this work?Thanks in advance.
>
> Alex
>


--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws




--
借鉴/思考/执行/检验/推广

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to make mysql as database?

Alessandro Vernet
Administrator
Alex,

On 7/4/07, Alex Chew <[hidden email]> wrote:
> I didnot get any error message on the page, but "add" operation does
> nothing.

Do you get any error in the ops.log file (or equivalent, depending on
what your log4j.xml configuration is)? The service-*.xpl file are
called as "services", with an XForms submission. So if they fail, most
likely you won't see any error in the UI. But you should see an error
in ops.log.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to make mysql as database?

Suganda
hi all,

i also get the same problem
i tried to duplicate the xforms-sql-address-book and following the same procedure
create table works properly
but when i want to insert data from fron-end layer using xforms- click add , the log doesnt show any error but it did nothing. i also couldn't see the record that i inputted in my database
any help ?

thanks in advance :)
suganda:)

here i attach my project
xforms-sql-forms.zip
Alessandro Vernet wrote
Alex,

On 7/4/07, Alex Chew <chew.alex@gmail.com> wrote:
> I didnot get any error message on the page, but "add" operation does
> nothing.

Do you get any error in the ops.log file (or equivalent, depending on
what your log4j.xml configuration is)? The service-*.xpl file are
called as "services", with an XForms submission. So if they fail, most
likely you won't see any error in the UI. But you should see an error
in ops.log.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws