SQL Address book

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

SQL Address book

hodack
Hi,

I've just started to look at OPS interacting with a mysql database by
looking at the documentation and SQL Address Book sample available here :
http://www.orbeon.com/ops/xforms-sql-address-book/

I've seen that this application uses a
ops/WEB-INF/resources/config/datasource-sql.xml configuration file,
where the default is the embedded hsqldb configuration.
I tried to configure a mysql jdbc connection :
1. downloaded mysql-connector.jar
2. put it in ops/WEB-INF/lib
3. created the "ops" database
4.
modified datasource-sql.xml as follows :
<datasource>
    <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
    <uri>jdbc:mysql://localhost:3306/ops</uri>
    <username>root</username>
    <password></password>
</datasource>

I could check that the jdbc connection was ok, but the sample doesn't
seem to be working anymore, no tables are created (database is empty).

Is the application still supposed to work with this new configuration or
did I miss something ?

Thanks for your help.



--
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: SQL Address book

Erik Bruchez
Administrator
The answer is that it *should* work, but I don't think we ever tested
this example with MySQL.

Just a note in passing about datasource-sql.xml: this is really designed
for sample applications and demos, because this doesn't make use of JDBC
connection pooling, for example. Ideally you should later migrate to
declaring your datasource in your web.xml, configure it in your app
server / servlet container, and the refer to it with the
<sql:datasource> element in the SQL processor configuration.

This said, this is probably not the cause of your problem.

Maybe the SQL that creates the tables works with HSQLDB but not with
MySQL? If not, you should see an error somewhere in the logs. Can you
see something?

-Erik

Kim-Vân Ho-Dac wrote:

> Hi,
>
> I've just started to look at OPS interacting with a mysql database by
> looking at the documentation and SQL Address Book sample available here :
> http://www.orbeon.com/ops/xforms-sql-address-book/
>
> I've seen that this application uses a
> ops/WEB-INF/resources/config/datasource-sql.xml configuration file,
> where the default is the embedded hsqldb configuration.
> I tried to configure a mysql jdbc connection :
> 1. downloaded mysql-connector.jar
> 2. put it in ops/WEB-INF/lib
> 3. created the "ops" database
> 4.
> modified datasource-sql.xml as follows :
> <datasource>
>    <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>    <uri>jdbc:mysql://localhost:3306/ops</uri>
>    <username>root</username>
>    <password></password>
> </datasource>
>
> I could check that the jdbc connection was ok, but the sample doesn't
> seem to be working anymore, no tables are created (database is empty).
>
> Is the application still supposed to work with this new configuration or
> did I miss something ?
>
> Thanks for your help.
>

--
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: SQL Address book

hodack
Hi,

I could make it work by now, the problem was with the mysql syntax which
is somehow different from the hsqldb one.

Thanks anyway for answering.

Erik Bruchez a écrit :

> The answer is that it *should* work, but I don't think we ever tested
> this example with MySQL.
>
> Just a note in passing about datasource-sql.xml: this is really
> designed for sample applications and demos, because this doesn't make
> use of JDBC connection pooling, for example. Ideally you should later
> migrate to declaring your datasource in your web.xml, configure it in
> your app server / servlet container, and the refer to it with the
> <sql:datasource> element in the SQL processor configuration.
>
> This said, this is probably not the cause of your problem.
>
> Maybe the SQL that creates the tables works with HSQLDB but not with
> MySQL? If not, you should see an error somewhere in the logs. Can you
> see something?
>
> -Erik
>
> Kim-Vân Ho-Dac wrote:
>> Hi,
>>
>> I've just started to look at OPS interacting with a mysql database by
>> looking at the documentation and SQL Address Book sample available
>> here :
>> http://www.orbeon.com/ops/xforms-sql-address-book/
>>
>> I've seen that this application uses a
>> ops/WEB-INF/resources/config/datasource-sql.xml configuration file,
>> where the default is the embedded hsqldb configuration.
>> I tried to configure a mysql jdbc connection :
>> 1. downloaded mysql-connector.jar
>> 2. put it in ops/WEB-INF/lib
>> 3. created the "ops" database
>> 4.
>> modified datasource-sql.xml as follows :
>> <datasource>
>>    <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>>    <uri>jdbc:mysql://localhost:3306/ops</uri>
>>    <username>root</username>
>>    <password></password>
>> </datasource>
>>
>> I could check that the jdbc connection was ok, but the sample doesn't
>> seem to be working anymore, no tables are created (database is empty).
>>
>> Is the application still supposed to work with this new configuration
>> or did I miss something ?
>>
>> Thanks for your help.
>>
>
>



--
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