I have created a sample application with MySQL as a backend. I did all the configurations for MySQL like changing the values in DataSource.groovy file. When i run the application i get an error lik this
k let me tell it clear.. i have configured in datasource file with jdbc://mysql/localhost/db_name. Now the db_name is the database name that should be created and updated with corresponding columns. Am not getting any error but i want to know where the database is created. If its in my system am sure it doesnt created since i analysed my all sql files. so where the databse file is created this is my question. hope you got now
Unless you write code to create a database schema, it will not be created for you by the connection alone. You would need to do that yourself and then your JDBC code connects to said schema so you can perform operations on it. You should read the basic JDBC Tutorial so that you understand what you're doing.
George i think you dint get me yet. My database connection is working well without any error i can view and add some data also. My question is i cant see the values what am adding and viewing in the mysql browser. Do the grails store the values am adding somewhere.
Sabarish Venkat wrote:George i think you dint get me yet.
Who is George?
Sabarish Venkat wrote:My database connection is working well without any error i can view and add some data also. My question is i cant see the values what am adding and viewing in the mysql browser. Do the grails store the values am adding somewhere.
What "mysql browser" are you using? How can you be sure the values are saving if you can't see the data? Grails fails silently if there are validation errors. You're probably going to have to show us at the very least a Domain class and the Controller code where you are populating and saving the data.
You also might want check for validation errors (if you're not already) in the controller to see what is happening. Or you can add failOnError: true to the save() method and it will throw an exception if validation fails.
Sorry Gregg i dint see your name properly .. Am saying about MySQL Query Browser to view the schemas.. I can see the output in browser without any errors. using scaffold i can add dynamic data also no errors am seeing but in the case like if i want to take back up the application how can i take without seeing it. am getting doubt whether data are saving are not also
Hi gregg and all i got it worked ... what the mistake i did is in buildconfig.groovy the dependencies of MySQL should be runtime 'mysql:mysql-connector-java:5.1.16' . I dint do this earlier. Also the data i viewed and stored is in tempDB that i was not aware thinking that it is inserting inside. Now everything got cleared. Thanks to one and all.
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
Two software engineers solve most of the world's problems in one K&R sized book