This document provides a tutorial for connecting a Grails application to a MySQL database and performing basic CRUD operations. It describes creating databases in MySQL, generating a Grails application, configuring the data source properties to connect to MySQL, generating a domain class and controller with scaffolding, and verifying the application works by interacting with the database. The tutorial shows how to set up the development and production environments to use different databases.
This tutorial is about Grails and Ajax. The tutorial includes an introduction to Ajax, Grails inbuilt support for Ajax, Ajax enabled Form fields, a note on Ajax and Performance. The tutorial begins with an introduction to Ajax. This section gives a detailed introduction of Ajax as a technology, and also presents the flow of Ajax. The introduction section is followed by Grails support section.
This section explains Grails inbuilt support for Ajax by providing a prototype library. It also includes form remote, remote function, executing before and after a call, handling events as a part of Grails support. The next section is about Ajax enabled Form fields.
This section informs about Ajax codes enabling Form Fields. The last section of this tutorial is a note on Ajax. This section includes Ajax and its performance as a technology like serving as a mechanism, debugging is tough, caching is an important technique, Ajax call is a remote network call.
Here I discuss about reactive programming, observable, observer and difference between observable and promise.
Also discuss some of important operators like forkJoin, switchMap, from, deboucneTime, discardUntilChanged, mergeMap. I discuss some of observable creation function.
This tutorial is about Grails and Ajax. The tutorial includes an introduction to Ajax, Grails inbuilt support for Ajax, Ajax enabled Form fields, a note on Ajax and Performance. The tutorial begins with an introduction to Ajax. This section gives a detailed introduction of Ajax as a technology, and also presents the flow of Ajax. The introduction section is followed by Grails support section.
This section explains Grails inbuilt support for Ajax by providing a prototype library. It also includes form remote, remote function, executing before and after a call, handling events as a part of Grails support. The next section is about Ajax enabled Form fields.
This section informs about Ajax codes enabling Form Fields. The last section of this tutorial is a note on Ajax. This section includes Ajax and its performance as a technology like serving as a mechanism, debugging is tough, caching is an important technique, Ajax call is a remote network call.
Here I discuss about reactive programming, observable, observer and difference between observable and promise.
Also discuss some of important operators like forkJoin, switchMap, from, deboucneTime, discardUntilChanged, mergeMap. I discuss some of observable creation function.
A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module.
ngif
ngFor
If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.
Understanding Database Transactions and Hibernate Sessions in GrailsJonas Witt
Using a REST API project backed by GORM / SQL as an example, this talk gives an overview of the layers that are between the GORM objects that you interact with and their persistence. It talks about how to ensure correctness in your transactions and avoid performance problems in Hibernate sessions.
JavaScript has some stunning features like Closures, Prototype etc. which can help to improve the readability and maintainability of the code. However, it is not easy for inexperienced developer to consume and apply those features in day to day coding. The purpose of the presentation ‘Advanced JavaScript’ is to help a reader easily understand the concept and implementation of some advanced JavaScript features.
JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.
Introduction to angular with a simple but complete projectJadson Santos
A simple front end project with angular. Its show how to create your first components, include bootstrap templates, create routes and build the project to production.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module.
ngif
ngFor
If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.
Understanding Database Transactions and Hibernate Sessions in GrailsJonas Witt
Using a REST API project backed by GORM / SQL as an example, this talk gives an overview of the layers that are between the GORM objects that you interact with and their persistence. It talks about how to ensure correctness in your transactions and avoid performance problems in Hibernate sessions.
JavaScript has some stunning features like Closures, Prototype etc. which can help to improve the readability and maintainability of the code. However, it is not easy for inexperienced developer to consume and apply those features in day to day coding. The purpose of the presentation ‘Advanced JavaScript’ is to help a reader easily understand the concept and implementation of some advanced JavaScript features.
JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.
Introduction to angular with a simple but complete projectJadson Santos
A simple front end project with angular. Its show how to create your first components, include bootstrap templates, create routes and build the project to production.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
This slide deck gives an overview of the Azure Machine Learning Service. It highlights benefits of Azure Machine Learning Workspace, Automated Machine Learning and integration Notebook scripts
Make Your Build Great Again (DroidConSF 2017)Jared Burrows
Slow builds have been plaguing Android development since the very beginning, especially for large multi-dex projects. As libraries tend to grow in size and the more libraries an application consumes it will slow down the build, especially when an application goes over the mutli-dex limit. Libraries aren't the only thing that can slow down the build, adding many Gradle plugins and repositories can increase the time it takes to configure the Gradle build. This talk will be centered around how I was able to decrease Yammer for Android's Gradle build times by optimizing our use of the Android Gradle plugin and the Gradle setup of our multi-project build and will give several tools and tips on how to help you profile and decrease your build times as well.
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
This presentation was prepared for a Webcast where John Yerhot, Engine Yard US Support Lead, and Chris Kelly, Technical Evangelist at New Relic discussed how you can scale and improve the performance of your Ruby web apps. They shared detailed guidance on issues like:
Caching strategies
Slow database queries
Background processing
Profiling Ruby applications
Picking the right Ruby web server
Sharding data
Attendees will learn how to:
Gain visibility on site performance
Improve scalability and uptime
Find and fix key bottlenecks
See the on-demand replay:
http://pages.engineyard.com/6TipsforImprovingRubyApplicationPerformance.html
Blue Green Sitecore Deployments on AzureRob Habraken
The sildes of my presentation on the Sitecore User Group Jordan meetup on April 24th 2017 and the Sitecore User Group Belarus meetup on April 27th, presenting and demoing the blue green provisioning of Sitecore into Azure using Azure Web Apps. Note that these slides do not contain the demo itself. For the demo, view the recording of the presentation or read my blog post, both accessable via https://www.robhabraken.nl
The presentation of the Drupal frontend optimizations from Drupal Camp LA 2011. The slides go over optimizations you do in the backend to serve files in the frontend faster and optimizations in the front end to css and javascript to make that aspect run faster.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
3. • By default, Grails applications are configured to
use an in-memory HSQLDB database for
development and testing
• Now we will create application to store student
information in database.
• Create 2 new databases that will be used by our
application
• create database student_registration;
• create database student_registration_prod;
5. • After creating the database, the next thing to do is
to create a new application.
• grails create-app student-registraion
• After creating the application, the next step is to
setup the its dependencies. There are two ways of
setting up the application to use MySQL database,
However, I prefer this way since it is much easier.
•Inside the file BuildConfig.groovy file under grails-
app/conf, find and uncomment the line which says:
• //runtime 'mysql:mysql-connector-java:5.1.16'
• As of this writing, the latest versioin of the JDBC is
5.1.18, so update accordingly.
6. • You also need to uncomment maven repository if it is
commented (mavenCentral())
• Note : if application failed to start, then add mysql-
connector-java-5.1.18-bin.jar in lib directory
• Now we are ready to add database details. We need
to Update DataSource.groovy file under grails-
app/conf.
dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
dialect =
"org.hibernate.dialect.MySQL5InnoDBDialect"
}
7. • We need to change the driverClassName to point to
the proper class.
• Also, since we are using the InnoDB engine, we will be
setting the dialect
dialect =
"org.hibernate.dialect.MySQL5InnoDBDialect"
• Note : If application failed to start bcoz of database
credentials add the 2 entries after dialect
• username=“username”
• password=“password”
8. • Next step just shows you how to configure
environment variable for database
• Let us use the two databases we created a while ago.
• For development & test environment, let us use the
student_registration database. On the other hand, for
the production environment, let us use the
student_registration_prod database.
9. For Development & Test use same datasource
development {
dataSource {
dbCreate = "create-drop"
url =
"jdbc:mysql://localhost/student_registration?
useUnicode=yes&characterEncoding=UTF-8"
username = "root“
password = ""
}
}
• Note for dbCreate read next slide
10. For Production use same datasource
production {
dataSource {
dbCreate = “update"
url =
"jdbc:mysql://localhost/student_registration?
useUnicode=yes&characterEncoding=UTF-8"
username = "root“
password = ""
}
}
11. dbCreate
•dbCreate deserves a special mention, It determines
what happens to your database between server
restarts.
• For example, a value of create-drop means that the
database tables will be dropped and then recreated
when you start the server, so you lose any data that
was in there. This is fine for testing, but is definitely
not what you want in production
13. •The next step is to create a domain class that will be
persisted later in our database. Let’s create a sample
domain class.
• create-domain-class com.reg.Student
• Now update the Student.groovy file in domain dir
class Student {
String studentID
String firstName
String middleName
String lastName
Integer year
static constraints = { }
}
14. •The next step is to create a controller class
• create-controller com.reg.Student
• Update the file StudentController.groovy under
grails-app/controller/com.reg/.
• Inside the controller, we will define a scaffold which
will automatically create the CRUD (Create, Read,
Update, Delete) functionality for our domain class
class StudentController {
def scaffold = Student
def index() { }
}
15. •The next step is to generate a view for Student
• generate-views com.reg.Student
• There is no need to change in view (.gsp) pages. The
grails automatically creates all CRUD
(Create,Read,Update,Delete) functionality for you.
• You just need to care about the url mapping for all.
After running your application if your controller id
redirected to “index” then write “create” instead of
“index”.
• I don’t know where is url mapping configured in grails,
that’s why I use this to redirect the pages.
16. • Now its time to start your grails student-registration
application
• grails run-app
• If your application starts without any errors, use the
url printed on console to access your app.
• Now connect to your student_registration database in
mysql
• connect student_registration;
• Now you notice that new table student is created.
• desc student;
17. • Now access the url and check all CRUD
(Create,Read,Update,Delete) functionality is working or
not.
• http://localhost:8080/student-
registraion/student/create
• Check the database values after each create,update &
delete.
18. Thank you
• I am not expert in grails, but if you have any doubts in
tutorial please feel free to contact me on
ashishkirpan@gmail.com
• Sorry for grammar mistakes :)