connecting a grails application to Mysql db

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

connecting a grails application to Mysql db

illusionisten
Hello everybody,
I'm new to this forum and I'm having a problem with my test application named "race track" in the book "Getting started with grails".
After creating my domain classes and controllers I created 3 dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I also modified the file DataSource.groovy, but when I try to have a look to my developement db I don't find any table ('empty set') and I got this in my browser:

Error Details
Error 500: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
Servlet: grails
URI: /racetrack/grails/race/list.dispatch
Exception Message: Table not found in statement [select top ? this_.id as id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost as cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_, this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state as state1_0_ from race this_]
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
Class: script1249390810640
At Line: [12]
Code Snippet:

Note that I've put the mysql-connector-java file into the lib directory of my Grails application (racetrack/lib).
Help me please I've tried many solutions but none of them worked !
Reply | Threaded
Open this post in threaded view
|

RE: connecting a grails application to Mysql db

Matthew.Lachman
What is your db-create scheme set to in DataSource.groovy?

Matt

-----Original Message-----
From: illusionisten [mailto:[hidden email]]
Sent: Tuesday, August 04, 2009 2:14 PM
To: [hidden email]
Subject: [grails-user] connecting a grails application to Mysql db


Hello everybody,
I'm new to this forum :-):-)and I'm having a problem with my test
application named "race track" in the book "Getting started with
grails".
After creating my domain classes and controllers I created 3
dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
also
modified the file DataSource.groovy, but when I try to have a look to my
developement db I don't find any table ('empty set') and I got this in
my
browser:

Error Details
Error 500:
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute query; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute query
Servlet: grails
URI: /racetrack/grails/race/list.dispatch
Exception Message: Table not found in statement [select top ? this_.id
as
id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
as
cost1_0_, this_.distance as distance1_0_, this_.max_runners as
max6_1_0_,
this_.name as name1_0_, this_.start_date_time as start8_1_0_,
this_.state as
state1_0_ from race this_]
Caused by:
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute query; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute query
Class: script1249390810640
At Line: [12]
Code Snippet:

Note that I've put the mysql-connector-java file into the lib directory
of
my Grails application (racetrack/lib).
Help me please I've tried many solutions but none of them worked :,(!
--
View this message in context:
http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp2481
3576p24813576.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: connecting a grails application to Mysql db

illusionisten
It's set to "update".
Matthew.Lachman wrote
What is your db-create scheme set to in DataSource.groovy?

Matt

-----Original Message-----
From: illusionisten [mailto:illusionisten@live.fr]
Sent: Tuesday, August 04, 2009 2:14 PM
To: user@grails.codehaus.org
Subject: [grails-user] connecting a grails application to Mysql db


Hello everybody,
I'm new to this forum :-):-)and I'm having a problem with my test
application named "race track" in the book "Getting started with
grails".
After creating my domain classes and controllers I created 3
dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
also
modified the file DataSource.groovy, but when I try to have a look to my
developement db I don't find any table ('empty set') and I got this in
my
browser:

Error Details
Error 500:
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute query; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute query
Servlet: grails
URI: /racetrack/grails/race/list.dispatch
Exception Message: Table not found in statement [select top ? this_.id
as
id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
as
cost1_0_, this_.distance as distance1_0_, this_.max_runners as
max6_1_0_,
this_.name as name1_0_, this_.start_date_time as start8_1_0_,
this_.state as
state1_0_ from race this_]
Caused by:
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute query; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute query
Class: script1249390810640
At Line: [12]
Code Snippet:

Note that I've put the mysql-connector-java file into the lib directory
of
my Grails application (racetrack/lib).
Help me please I've tried many solutions but none of them worked :,(!
--
View this message in context:
http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp2481
3576p24813576.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

burtbeckwith
In reply to this post by illusionisten
It's probably your DataSource.groovy. Take a look at the docs for the DataSource file: http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource

That book is very dated and was based on version 0.6 of Grails - a lot has changed since then. The Grails docs are very good and there are several newer books available that cover 1.1: http://grails.org/Books

If that doesn't help, post your DataSource.groovy.

Burt

On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:

>
> Hello everybody,
> I'm new to this forum :-):-)and I'm having a problem with my test
> application named "race track" in the book "Getting started with grails".
> After creating my domain classes and controllers I created 3
> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I also
> modified the file DataSource.groovy, but when I try to have a look to my
> developement db I don't find any table ('empty set') and I got this in my
> browser:
>
> Error Details
> Error 500: org.springframework.dao.InvalidDataAccessResourceUsageException:
> could not execute query; nested exception is
> org.hibernate.exception.SQLGrammarException: could not execute query
> Servlet: grails
> URI: /racetrack/grails/race/list.dispatch
> Exception Message: Table not found in statement [select top ? this_.id as
> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost as
> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state as
> state1_0_ from race this_]
> Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException:
> could not execute query; nested exception is
> org.hibernate.exception.SQLGrammarException: could not execute query
> Class: script1249390810640
> At Line: [12]
> Code Snippet:
>
> Note that I've put the mysql-connector-java file into the lib directory of
> my Grails application (racetrack/lib).
> Help me please I've tried many solutions but none of them worked :,(!


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

bdrhoa
In reply to this post by illusionisten
It needs to be "create" or "create-drop".

On Tue, Aug 4, 2009 at 12:23 PM, illusionisten<[hidden email]> wrote:

>
> It's set to "update".
>
> Matthew.Lachman wrote:
>>
>> What is your db-create scheme set to in DataSource.groovy?
>>
>> Matt
>>
>> -----Original Message-----
>> From: illusionisten [mailto:[hidden email]]
>> Sent: Tuesday, August 04, 2009 2:14 PM
>> To: [hidden email]
>> Subject: [grails-user] connecting a grails application to Mysql db
>>
>>
>> Hello everybody,
>> I'm new to this forum :-):-)and I'm having a problem with my test
>> application named "race track" in the book "Getting started with
>> grails".
>> After creating my domain classes and controllers I created 3
>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>> also
>> modified the file DataSource.groovy, but when I try to have a look to my
>> developement db I don't find any table ('empty set') and I got this in
>> my
>> browser:
>>
>> Error Details
>> Error 500:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Servlet: grails
>> URI: /racetrack/grails/race/list.dispatch
>> Exception Message: Table not found in statement [select top ? this_.id
>> as
>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>> as
>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as
>> max6_1_0_,
>> this_.name as name1_0_, this_.start_date_time as start8_1_0_,
>> this_.state as
>> state1_0_ from race this_]
>> Caused by:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Class: script1249390810640
>> At Line: [12]
>> Code Snippet:
>>
>> Note that I've put the mysql-connector-java file into the lib directory
>> of
>> my Grails application (racetrack/lib).
>> Help me please I've tried many solutions but none of them worked :,(!
>> --
>> View this message in context:
>> http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp2481
>> 3576p24813576.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24813744.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

illusionisten
I read the doc but everything seems to be alright and also I tried both "create" and "create-drop" in my datasource file but it doesn't work!
Brad Rhoads-2 wrote
It needs to be "create" or "create-drop".

On Tue, Aug 4, 2009 at 12:23 PM, illusionisten<illusionisten@live.fr> wrote:
>
> It's set to "update".
>
> Matthew.Lachman wrote:
>>
>> What is your db-create scheme set to in DataSource.groovy?
>>
>> Matt
>>
>> -----Original Message-----
>> From: illusionisten [mailto:illusionisten@live.fr]
>> Sent: Tuesday, August 04, 2009 2:14 PM
>> To: user@grails.codehaus.org
>> Subject: [grails-user] connecting a grails application to Mysql db
>>
>>
>> Hello everybody,
>> I'm new to this forum :-):-)and I'm having a problem with my test
>> application named "race track" in the book "Getting started with
>> grails".
>> After creating my domain classes and controllers I created 3
>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>> also
>> modified the file DataSource.groovy, but when I try to have a look to my
>> developement db I don't find any table ('empty set') and I got this in
>> my
>> browser:
>>
>> Error Details
>> Error 500:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Servlet: grails
>> URI: /racetrack/grails/race/list.dispatch
>> Exception Message: Table not found in statement [select top ? this_.id
>> as
>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>> as
>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as
>> max6_1_0_,
>> this_.name as name1_0_, this_.start_date_time as start8_1_0_,
>> this_.state as
>> state1_0_ from race this_]
>> Caused by:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Class: script1249390810640
>> At Line: [12]
>> Code Snippet:
>>
>> Note that I've put the mysql-connector-java file into the lib directory
>> of
>> my Grails application (racetrack/lib).
>> Help me please I've tried many solutions but none of them worked :,(!
>> --
>> View this message in context:
>> http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp2481
>> 3576p24813576.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24813744.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

illusionisten
In reply to this post by burtbeckwith
Here is my datasource file:
DataSource.groovy
Burt Beckwith wrote
It's probably your DataSource.groovy. Take a look at the docs for the DataSource file: http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource

That book is very dated and was based on version 0.6 of Grails - a lot has changed since then. The Grails docs are very good and there are several newer books available that cover 1.1: http://grails.org/Books

If that doesn't help, post your DataSource.groovy.

Burt

On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>
> Hello everybody,
> I'm new to this forum :-):-)and I'm having a problem with my test
> application named "race track" in the book "Getting started with grails".
> After creating my domain classes and controllers I created 3
> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I also
> modified the file DataSource.groovy, but when I try to have a look to my
> developement db I don't find any table ('empty set') and I got this in my
> browser:
>
> Error Details
> Error 500: org.springframework.dao.InvalidDataAccessResourceUsageException:
> could not execute query; nested exception is
> org.hibernate.exception.SQLGrammarException: could not execute query
> Servlet: grails
> URI: /racetrack/grails/race/list.dispatch
> Exception Message: Table not found in statement [select top ? this_.id as
> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost as
> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state as
> state1_0_ from race this_]
> Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException:
> could not execute query; nested exception is
> org.hibernate.exception.SQLGrammarException: could not execute query
> Class: script1249390810640
> At Line: [12]
> Code Snippet:
>
> Note that I've put the mysql-connector-java file into the lib directory of
> my Grails application (racetrack/lib).
> Help me please I've tried many solutions but none of them worked :,(!


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

burtbeckwith
Right, that's the old format. Remove the types (String, boolean). See the docs for the proper format.

Burt


illusionisten wrote:


Here is my datasource file:
http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy

Burt Beckwith wrote:
>
> It's probably your DataSource.groovy. Take a look at the docs for the
> DataSource file:
> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource
>
> That book is very dated and was based on version 0.6 of Grails - a lot has
> changed since then. The Grails docs are very good and there are several
> newer books available that cover 1.1: http://grails.org/Books
>
> If that doesn't help, post your DataSource.groovy.
>
> Burt
>
> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>
>> Hello everybody,
>> I'm new to this forum :-):-)and I'm having a problem with my test
>> application named "race track" in the book "Getting started with grails".
>> After creating my domain classes and controllers I created 3
>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>> also
>> modified the file DataSource.groovy, but when I try to have a look to my
>> developement db I don't find any table ('empty set') and I got this in my
>> browser:
>>
>> Error Details
>> Error 500:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Servlet: grails
>> URI: /racetrack/grails/race/list.dispatch
>> Exception Message: Table not found in statement [select top ? this_.id as
>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>> as
>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>> as
>> state1_0_ from race this_]
>> Caused by:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Class: script1249390810640
>> At Line: [12]
>> Code Snippet:
>>
>> Note that I've put the mysql-connector-java file into the lib directory
>> of
>> my Grails application (racetrack/lib).
>> Help me please I've tried many solutions but none of them worked :,(!
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24814371.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

Todd Ellermann
In reply to this post by illusionisten

I think you want pooled not pooling as well
May also consider this with mysql to tell hibernate it is going to be an
Innodb database (assuming you want something transactional).

dialect = org.hibernate.dialect.MySQLInnoDBDialect.class
Which has nothing to do with your problem.  But something to be aware of.

May also want this with mysql to force UTF8:
url = "jdbc:mysql://localhost/racetrack_dev?characterEncoding=UTF8"



On 8/4/09 12:05 PM, "illusionisten" <[hidden email]> wrote:

>
> Here is my datasource file:
> http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy
>
> Burt Beckwith wrote:
>>
>> It's probably your DataSource.groovy. Take a look at the docs for the
>> DataSource file:
>> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSou
>> rce
>>
>> That book is very dated and was based on version 0.6 of Grails - a lot has
>> changed since then. The Grails docs are very good and there are several
>> newer books available that cover 1.1: http://grails.org/Books
>>
>> If that doesn't help, post your DataSource.groovy.
>>
>> Burt
>>
>> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>>
>>> Hello everybody,
>>> I'm new to this forum :-):-)and I'm having a problem with my test
>>> application named "race track" in the book "Getting started with grails".
>>> After creating my domain classes and controllers I created 3
>>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>>> also
>>> modified the file DataSource.groovy, but when I try to have a look to my
>>> developement db I don't find any table ('empty set') and I got this in my
>>> browser:
>>>
>>> Error Details
>>> Error 500:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Servlet: grails
>>> URI: /racetrack/grails/race/list.dispatch
>>> Exception Message: Table not found in statement [select top ? this_.id as
>>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>>> as
>>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>>> as
>>> state1_0_ from race this_]
>>> Caused by:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Class: script1249390810640
>>> At Line: [12]
>>> Code Snippet:
>>>
>>> Note that I've put the mysql-connector-java file into the lib directory
>>> of
>>> my Grails application (racetrack/lib).
>>> Help me please I've tried many solutions but none of them worked :,(!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>

Todd R. Ellermann
Vice President, Engineering

VirtualTourist.com a
TripAdvisor Media Group Company
1600 Rosecrans Ave. Bldg 6b, 2nd floor, Manhattan Beach, CA 90266-3708

310.750.7992 c
310.727.2602 p ext 71100
310.727.2603 f

[hidden email]
http://members.virtualtourist.com/toddecus
 
VirtualTourist.com is a:
TRAVEL + LEISURE '35 Best Travel Site'
YAHOO! 'Most Popular Destination Guide'
NEWSWEEK 'Favorite Website'
TIME  'Recommended Travel Forum'
AOL 'Editor's Pick'
USA TODAY 'Hot Site'
U.S. NEWS 'Best of the Web'
CNET 'Best of the Web'



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

illusionisten
I changed the url but still dosn't work.But I don't know where to put the line "dialect = org.hibernate.dialect.MySQLInnoDBDialect.class". Thank you
Todd Ellermann wrote
I think you want pooled not pooling as well
May also consider this with mysql to tell hibernate it is going to be an
Innodb database (assuming you want something transactional).

dialect = org.hibernate.dialect.MySQLInnoDBDialect.class
Which has nothing to do with your problem.  But something to be aware of.

May also want this with mysql to force UTF8:
url = "jdbc:mysql://localhost/racetrack_dev?characterEncoding=UTF8"



On 8/4/09 12:05 PM, "illusionisten" <illusionisten@live.fr> wrote:

>
> Here is my datasource file:
> http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy
>
> Burt Beckwith wrote:
>>
>> It's probably your DataSource.groovy. Take a look at the docs for the
>> DataSource file:
>> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSou
>> rce
>>
>> That book is very dated and was based on version 0.6 of Grails - a lot has
>> changed since then. The Grails docs are very good and there are several
>> newer books available that cover 1.1: http://grails.org/Books
>>
>> If that doesn't help, post your DataSource.groovy.
>>
>> Burt
>>
>> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>>
>>> Hello everybody,
>>> I'm new to this forum :-):-)and I'm having a problem with my test
>>> application named "race track" in the book "Getting started with grails".
>>> After creating my domain classes and controllers I created 3
>>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>>> also
>>> modified the file DataSource.groovy, but when I try to have a look to my
>>> developement db I don't find any table ('empty set') and I got this in my
>>> browser:
>>>
>>> Error Details
>>> Error 500:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Servlet: grails
>>> URI: /racetrack/grails/race/list.dispatch
>>> Exception Message: Table not found in statement [select top ? this_.id as
>>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>>> as
>>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>>> as
>>> state1_0_ from race this_]
>>> Caused by:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Class: script1249390810640
>>> At Line: [12]
>>> Code Snippet:
>>>
>>> Note that I've put the mysql-connector-java file into the lib directory
>>> of
>>> my Grails application (racetrack/lib).
>>> Help me please I've tried many solutions but none of them worked :,(!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>

Todd R. Ellermann
Vice President, Engineering

VirtualTourist.com a
TripAdvisor Media Group Company
1600 Rosecrans Ave. Bldg 6b, 2nd floor, Manhattan Beach, CA 90266-3708

310.750.7992 c
310.727.2602 p ext 71100
310.727.2603 f

todd@virtualtourist.com
http://members.virtualtourist.com/toddecus
 
VirtualTourist.com is a:
TRAVEL + LEISURE '35 Best Travel Site'
YAHOO! 'Most Popular Destination Guide'
NEWSWEEK 'Favorite Website'
TIME  'Recommended Travel Forum'
AOL 'Editor's Pick'
USA TODAY 'Hot Site'
U.S. NEWS 'Best of the Web'
CNET 'Best of the Web'



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

bdrhoa
In reply to this post by illusionisten
Change:

dataSource {
        pooled = true
        driverClassName = "org.hsqldb.jdbcDriver"
        username = "sa"
        password = ""
}


to

dataSource {
        pooled = true
        driverClassName = "com.mysql.jdbc.Driver"
        username = "root"
        password = "groovy"
}


On Tue, Aug 4, 2009 at 1:05 PM, illusionisten<[hidden email]> wrote:

>
> Here is my datasource file:
> http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy
>
> Burt Beckwith wrote:
>>
>> It's probably your DataSource.groovy. Take a look at the docs for the
>> DataSource file:
>> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource
>>
>> That book is very dated and was based on version 0.6 of Grails - a lot has
>> changed since then. The Grails docs are very good and there are several
>> newer books available that cover 1.1: http://grails.org/Books
>>
>> If that doesn't help, post your DataSource.groovy.
>>
>> Burt
>>
>> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>>
>>> Hello everybody,
>>> I'm new to this forum :-):-)and I'm having a problem with my test
>>> application named "race track" in the book "Getting started with grails".
>>> After creating my domain classes and controllers I created 3
>>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>>> also
>>> modified the file DataSource.groovy, but when I try to have a look to my
>>> developement db I don't find any table ('empty set') and I got this in my
>>> browser:
>>>
>>> Error Details
>>> Error 500:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Servlet: grails
>>> URI: /racetrack/grails/race/list.dispatch
>>> Exception Message: Table not found in statement [select top ? this_.id as
>>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>>> as
>>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>>> as
>>> state1_0_ from race this_]
>>> Caused by:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Class: script1249390810640
>>> At Line: [12]
>>> Code Snippet:
>>>
>>> Note that I've put the mysql-connector-java file into the lib directory
>>> of
>>> my Grails application (racetrack/lib).
>>> Help me please I've tried many solutions but none of them worked :,(!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24814371.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

illusionisten
This time I got the message:
HTTP ERROR: 503
SERVICE_UNAVAILABLE
RequestURI=/racetrack/
in my browser and in my commande line I got this :(look at the attachment plz)
Powered by jetty://Nouveau+Document+texte.txt
Brad Rhoads-2 wrote
Change:

dataSource {
        pooled = true
        driverClassName = "org.hsqldb.jdbcDriver"
        username = "sa"
        password = ""
}


to

dataSource {
        pooled = true
        driverClassName = "com.mysql.jdbc.Driver"
        username = "root"
        password = "groovy"
}


On Tue, Aug 4, 2009 at 1:05 PM, illusionisten<illusionisten@live.fr> wrote:
>
> Here is my datasource file:
> http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy
>
> Burt Beckwith wrote:
>>
>> It's probably your DataSource.groovy. Take a look at the docs for the
>> DataSource file:
>> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource
>>
>> That book is very dated and was based on version 0.6 of Grails - a lot has
>> changed since then. The Grails docs are very good and there are several
>> newer books available that cover 1.1: http://grails.org/Books
>>
>> If that doesn't help, post your DataSource.groovy.
>>
>> Burt
>>
>> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>>
>>> Hello everybody,
>>> I'm new to this forum :-):-)and I'm having a problem with my test
>>> application named "race track" in the book "Getting started with grails".
>>> After creating my domain classes and controllers I created 3
>>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>>> also
>>> modified the file DataSource.groovy, but when I try to have a look to my
>>> developement db I don't find any table ('empty set') and I got this in my
>>> browser:
>>>
>>> Error Details
>>> Error 500:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Servlet: grails
>>> URI: /racetrack/grails/race/list.dispatch
>>> Exception Message: Table not found in statement [select top ? this_.id as
>>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>>> as
>>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>>> as
>>> state1_0_ from race this_]
>>> Caused by:
>>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>>> could not execute query; nested exception is
>>> org.hibernate.exception.SQLGrammarException: could not execute query
>>> Class: script1249390810640
>>> At Line: [12]
>>> Code Snippet:
>>>
>>> Note that I've put the mysql-connector-java file into the lib directory
>>> of
>>> my Grails application (racetrack/lib).
>>> Help me please I've tried many solutions but none of them worked :,(!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24814371.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

Ketul Gandhi
In reply to this post by illusionisten
You should remove type (String), otherwise they are considered local variables and remove line with pooling, as "pooled" will be inherited from global configuration on top.
 

-- Ketul




From: illusionisten <[hidden email]>

Here is my datasource file:
http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy

Burt Beckwith wrote:
>
> It's probably your DataSource.groovy. Take a look at the docs for the
> DataSource file:
> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource
>
> That book is very dated and was based on version 0.6 of Grails - a lot has
> changed since then. The Grails docs are very good and there are several
> newer books available that cover 1.1: http://grails.org/Books

>
> If that doesn't help, post your DataSource.groovy.
>
> Burt
>
> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>
>> Hello everybody,
>> I'm new to this forum :-):-)and I'm having a problem with my test
>> application named "race track" in the book "Getting started with grails".
>> After creating my domain classes and controllers I created 3
>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>> also
>> modified the file DataSource.groovy, but when I try to have a look to my
>> developement db I don't find any table ('empty set') and I got this in my
>> browser:
>>
>> Error Details
>> Error 500:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Servlet: grails
>> URI: /racetrack/grails/race/list.dispatch
>> Exception Message: Table not found in statement [select top ? this_.id as
>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>> as
>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>> as
>> state1_0_ from race this_]
>> Caused by:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Class: script1249390810640
>> At Line: [12]
>> Code Snippet:
>>
>> Note that I've put the mysql-connector-java file into the lib directory
>> of
>> my Grails application (racetrack/lib).
>> Help me please I've tried many solutions but none of them worked :,(!
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24814371.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: connecting a grails application to Mysql db

illusionisten
I made the changes and it worked perfectely thanks everybody and especially Ketul.
But I still don't understand why it worked with my freinds with the same configurations like in the book ("Grails getting started") but it didn't work with me ? Can anybody explain it plz?
Ketul Gandhi wrote
You should remove type (String), otherwise they are considered local variables and remove line with pooling, as "pooled" will be inherited from global configuration on top.

 
-- Ketul





________________________________
From: illusionisten <illusionisten@live.fr>

Here is my datasource file:
http://www.nabble.com/file/p24814371/DataSource.groovy DataSource.groovy

Burt Beckwith wrote:
>
> It's probably your DataSource.groovy. Take a look at the docs for the
> DataSource file:
> http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.3%20The%20DataSource
>
> That book is very dated and was based on version 0.6 of Grails - a lot has
> changed since then. The Grails docs are very good and there are several
> newer books available that cover 1.1: http://grails.org/Books
>
> If that doesn't help, post your DataSource.groovy.
>
> Burt
>
> On Tuesday 04 August 2009 2:13:47 pm illusionisten wrote:
>>
>> Hello everybody,
>> I'm new to this forum :-):-)and I'm having a problem with my test
>> application named "race track" in the book "Getting started with grails".
>> After creating my domain classes and controllers I created 3
>> dbs:racetrack_dev, racetrack_prod and racetrack_test with Mysql and I
>> also
>> modified the file DataSource.groovy, but when I try to have a look to my
>> developement db I don't find any table ('empty set') and I got this in my
>> browser:
>>
>> Error Details
>> Error 500:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Servlet: grails
>> URI: /racetrack/grails/race/list.dispatch
>> Exception Message: Table not found in statement [select top ? this_.id as
>> id1_0_, this_.version as version1_0_, this_.city as city1_0_, this_.cost
>> as
>> cost1_0_, this_.distance as distance1_0_, this_.max_runners as max6_1_0_,
>> this_.name as name1_0_, this_.start_date_time as start8_1_0_, this_.state
>> as
>> state1_0_ from race this_]
>> Caused by:
>> org.springframework.dao.InvalidDataAccessResourceUsageException:
>> could not execute query; nested exception is
>> org.hibernate.exception.SQLGrammarException: could not execute query
>> Class: script1249390810640
>> At Line: [12]
>> Code Snippet:
>>
>> Note that I've put the mysql-connector-java file into the lib directory
>> of
>> my Grails application (racetrack/lib).
>> Help me please I've tried many solutions but none of them worked :,(!
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context: http://www.nabble.com/connecting-a-grails-application-to-Mysql-db-tp24813576p24814371.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email