Principle of operation of a database


Databases have become key elements of the majority of applications. They replace the use of files managed by the developer itself. This contribution allows significant productivity gains during development and significantly improved application performance. They also facilitate the sharing of information between users. To use a database, you must know a minimum of vocabulary related to this technology, and we’ll see how to implement the same thing in a java 8 tutorial.

1. Terminology

In the context of databases, the following terms are frequently used:

  • Relational database: A relational database is a database type that uses tables to store information.They use values ​​from two tables to associate data table to the data in another table. Generally, in a relational database, the information is only stored once.

  • Table: A table is a component of a database that stores information in records (rows) and fields (columns). The information is generally grouped by category in a table. For example, we have the table of Customers, Products, or commands.

  • Registration: Registration is the set of information about an item in a table. Records are equivalent to logic rows of a table. For example, a recording of the Customers table contains the characteristics of a particular customer.

  • Field: a record comprises several fields. Every field in a record contains information about one-ment records. For example a customer record can contain CodeClient fields Name, First …

  • Primary key: a primary key is used to uniquely identify each row of a table. The primary key is a field or combination of fields whose value is unique in the table. For example, the CodeClient field is the primary key of the Customer table. There can not be two customers with the same code.

  • Foreign key: a foreign key is one or more fields in a table that refer to the fields of the primary key of another table. Foreign keys indicate how the tables are linked.

  • Relationship: A relationship is an association established between common fields in two tables. A relationship can be one to one, one to many or many to many. Through relationships, query results can include data from multiple tables. A relationship between a multi-client table and the table control allows a query to return all the orders corresponding to a client.

2. The SQL Language

Before you can write a Java application using data, you need to know what is java and what has to do with SQL, you should be familiar with SQL (Structured QueryLanguage). This language allows to interact with the database. There are different versions of SQL depending on the database used. However SQL also has a separate standardized basic syntax of any database.

to. Finding Information

The SQL language is used to specify the records to be extracted and the order in which you want to extract. You can create a SQL statement that retrieves information from multiple tables simultaneously, or you can create a statement that extracts only a specific recording. The instruction SELECT is used to return specific fields from one or more tables of the database.

The following statement returns the list of names and surnames of all records from the Customer table.

SELECT Name, Surname FROM Customer

You can use the * symbol in place of the list of fields that you want the value.

SELECT * FROM Customer

You can limit the number of records selected using one or more fields to filter the query result. Various clauses are available to perform this filtering.

WHERE clause

This clause allows you to specify a list of conditions to be met the records to be part of the returned results. The following example retrieves all customers living Nantes.

SELECT * FROM customer WHERE City = 'Nantes'

The syntax of the clause requires the use of a simple rating for delimiting character strings.

WHERE clause IN …

You can use the clause WHERE … IN to return all the records that meet a list of criteria. For example, you can search for all customers living in France or Spain.

SELECT * FROM customer WHERE Country IN ('France', 'Spain')


You can also return a selection of records that fall between two specified criteria. The following query will retrieve a list of orders in the month of November 2005.

SELECT * from Orders WHERE OrderDate BETWEEN '01 / 11/05 'AND '30 / 11/05'

WHERE clause … LIKE

You can use the clause WHERE … LIKE to return all the records for which there is a specific requirement for a given field. For example, the following syntax will select all customers whose name starts with a d:

SELECT * FROM customer WHERE name LIKE '% s'

In this statement, the% symbol is used to replace any sequence of characters.


You can use the clause ORDER BY to return records in a particular order. The option ASC indicates ascending order, the option DESC indicates descending order. Multiple fields can be specified as sorting criteria. They are analyzed from left to right. If tied to the value of a field, the next field is used.

SELECT * FROM Customer ORDER BY DESC Name, Surname ASC

This returns the clients sorted in descending order on behalf and in case of equality in ascending order on the first name.

b. Added information

The creation of records in a table is via the command INSERT INTO. You must indicate the table where you want to insert a line, the list of fields for which you specify a value and finally the list of corresponding values. The full syntax is as follows:

INSERT INTO customer (codeClient, name, first name) VALUES (1000, 'Smith', 'Pierre')

When adding this new client, only the first and last name will be filled in the table. The other fields take the value NULL. If the fields list is not specified, the statement INSERT requires that you specify a value for each field in the table. You are therefore obliged to use the keyword NULL to indicate that for a particular field there is no information. If the Customer table has five fields (codeClient, name, first name, address, country) the previous statement can be written with the following syntax:

INSERT INTO customer VALUES (1000, 'Smith', 'Pierre', NULL, NULL)

Note that in this case the two NULL key word are required for fields address and country.

c. Update information

Changing fields of existing records is performed by the instruction UPDATE. This statement can update several fields of several records in a table based on expressions that are provided. You must supply the table name to be updated and the value to be assigned to different fields. The list is indicated by the key word SET followed by the assignment of the new value to the various fields. If you want the changes concern only a limited set of records, you must specify the clause WHERE to limit the scope of the update. If any clause WHERE is indicated modification will be done on all table records.

For example, to change the address of a particular client, you can use the following statement:

UPDATE Customer SET Address = '4 rue de Paris 44000 Nantes' 
WHERE codeClient = 1000

If the amendment relates to all records in the table, the clause WHERE is useless. For example if you want to increase the price of all your items, you can use the following statement:

UPDATE SET CATALOG unitPrice unitPrice = 1.1 *

d. Delete Information

The instruction DELETE FROM deletes one or more records of a table-ments. You must at least provide the table name on which will make the deletion. If you do not specify further details, in this case all rows of the table are deleted. In general a clause WHERE is added for limiting the extent of the deletion. The following command deletes all records from the Customer table:


The following command is less radical and removes a particular record:

DELETE FROM Customer WHERE codeClient = 1000

The SQL language is of course much more comprehensive than that and can not be reduced to these five instructions. Nevertheless, they are sufficient for handling data from Java. If you want to deepen the learning of SQL I advise you to consult one of the books available in the same collection on this subject so further.

Going Reactive With Java 8 | Webinar -1

Watch Sample Class recording:

Edureka’s Java 8 course covers all the new features introduced in Java 8 like functional interfaces, lambdas and streams. Developers can use Java 8 to do functional programming in Java language. This course explains all the concepts of functional programming and how to do functional programming in Java. This course also dive into very powerful Java 8 Stream API which provides a way to perform all the collection related operations very easily Java is moving fast and having knowledge of Java 8 will certainly make you stand out from the crowd. At the end of this course you will also develop a project using all the Java 8 features taught

This video helps you to learn following topics :
1.Understand why java8 came into picture
2.Know hot topics in java 8
3.Demo on java 8
4.Quick Timeline of Java
5.Hot topics in Java8

Edureka is a New Age e-learning platform that provides Instructor-Led Live, Online classes for learners who would
prefer a hassle free and self paced learning environment, accessible from any part of the world.

The topics related to Selenium have extensively been covered in our course ‘Testing With Selenium WebDriver’.
For more information, please write back to us at [email protected]
Call us at US: 1800 275 9730 (toll free) or India: +91-8880862004

Java 8 Tutorial | Installing The JDK And Eclipse For Windows

Want all of our free Java training videos? Visit our Learning Library, which features all of our training courses and tutorials at

More details on this Java 8 training can be seen at This clip is one example from the complete course. For more free Java tutorials please visit our main website.

What’s new in Java 8 – Online Course

Course Link:

What’s new in Java 8
An in-depth look at the new features of Java 8

Course Description

This is PART 1 of a two part course looking at the new features of Java 8.

In this part, we take an in-depth look at lambdas and their supporting features; things like functional interfaces and type inference. In the follow up course (PART 2), we look at the remaining features.

After watching this course, you’ll

Have an overview of new features in Java 8
Understand lambdas in-depth, their background, syntax, implementation details and how and when to use them
Understand the difference between functions to classes and why that’s relevant to lambdas
Understand the difference between lambdas and closures
Appreciate the improvements to type inference that drive a lot of the new features
Be able to use method references and understand scoping and “effectively final”
Understand the differences in bytecode produced when using lambdas
Be able to reason about exceptions and exception handling best practice when using lambdasvariables
So whether you’re migrating existing Java programs to Java 8 or building applications from scratch, this course will help you start to leverage the power of functional programming on the Java platform.

Java Multithreading With Executors Course Lectures 1-12

This is a composite video of the first 12 lectures of an 8 hours online course on “Efficient Java Multithreading with Executors”. Click on the link at the top to know more!

Lecture-01 => 00:07 (About the course)
Lecture-02 => 02:59 (Pre-requisites and course structure)
Lecture-03 => 06:21 (Creating threads using Threads API | First technique)
Lecture-04 => 16:52 (Creating threads using Threads API | Second technique)
Lecture-05 => 21:23 (Creating threads using Threads API | Third technique)
Lecture-06 => 26:00 (Creating threads using Threads API | Fourth technique)
Lecture-07 => 29:55 (Creating threads using Threads API | Fifth technique)
Lecture-08 => 33:54 (Executors Framework Overview)
Lecture-09 => 38:03 (Important Interfaces and Classes in the Executors Framework)
Lecture-10 => 48:44 (Creating threads using Executors API | Fixed Thread Pool)
Lecture-11 => 59:21 (Creating threads using Executors API | Cached Thread Pool)
Lecture-12 => 1:04:53 (Creating threads using Executors API | Single Thread Executor)


An 8-hours course on multi-threading – it cannot get more detailed than that! Learn all the concepts of Java’s Executors API from scratch in combination with parallel concepts of the Threads API. Develop skills and deepen your knowledge of advanced multi-threading concepts by learning various tips & techniques and becoming aware of pitfalls when using Executors API. And … refresh your advanced Threads-API concepts as well.

– Do you know that you cannot catch stray exceptions leaked out from a thread by using try-catch block – neither in the Threads API nor in the Executors one? And that this can lead to third-party code killing your scalable, high-performance and high-availability enterprise application?
– Do you know how to return values using the normal Threads API and its Runnables?
– Do you know how to ‘join threads’ using Executors?
– Do you know the various ways of terminating threads midway for both the APIs?
– Do you know how to check if a task has finished execution using both the APIs?
– Do you know what are daemon threads and how to create them using Executors?
– Do you know how to name Executor threads?
– Do you know the various ways to schedule tasks for running in future using both the APIs?

If the answer to any of these questions is ‘no’, then this course is for you (provided that you know Java and the basics of multi-threading already)! Learning from Full-HD (1080p) videos and nearly 8 hours of content will help you convert all these “nos” to “yeses” … and will also give you an edge over your peers! Not only will this course help you learn how to get things done the multi-threaded way but also how to avoid the mistakes and pitfalls and thereby, increase your efficiency and productivity. All those long bug-fixing hours that you save can be spent finishing your other pending work or even for pleasure!


In my 13 years of experience building large enterprise applications, I have made all the mistakes in multi-threading that can be made. And believe me – multi-threading bugs are costly and multi-weekend-destroying to resolve.

I have used my vast experience to craft this course in such a manner so as to highlight the pitfalls that await a programmer and also provide tips to avoid those pitfalls. By going through this course, you will be years ahead of your peers who are yet to make all the mistakes that I have made.

Click on the link below to know more about the course and to claim your discount:

Java 8 Language Capabilities, What’s in it for you?

Recorded at SpringOne2GX 2014.
Speaker: Venkat Subramaniam
No Slides at speaker request
There is a good amount of excitement about the new version of Java. The big evolution of course is the lambda expressions. In this presentation we will dive into the language features in Java 8, take a look at some of their nuances, and look at ways to put them to good use. In addition to looking at lambdas we will also dive into the Streams capabilities and also some of the features in Java 8 that make all these possible.

September 11, 2014
10:30 AM – 12:00 PM
Dallas Ballroom E-F

Java 8 Tutorial | Course Project Class Diagram

Want all of our free Java training videos? Visit our Learning Library, which features all of our training courses and tutorials at

More details on this Java 8 training can be seen at This clip is one example from the complete course. For more free Java tutorials please visit our main website.

Lambda Expressions in Java – What’s New in Java 8 Part 1

Get complete courses at
An introduction to lambda expressions, the most important new language feature in Java 8. Lambda expressions allow you to pass blocks of code to methods; something that could previously only be achieved by implementing an interface.

This is John from and in this tutorial we’re going to look at lambda expressions in Java 8, so I’ve created a new project here and I’ve already got JDK8 installed, which you can see here, and I’m using it for this particular project. You might need to download a new eclipse to do this.

So, lambda expressions are just a way of passing a block of code to a method. That’s all they are. And I’m going to first go through how we would do this, very briefly, in previous versions of Java, and to understand this you need to have an understanding of interfaces and of implementing anonymous classes as well.

So, typical situations when you might want to do this would be when you want to pass code to a thread, to execute it in its own thread, and where you want to pass code to a button, let’s say in Java Swing, so that code can be executed when the button is clicked. If you want a some revision of any of this, I’ve got a massive free Java course that includes interfaces and anonymous classes and also a free course on multi-threading and also on Swing, and you can find those on

So let’s start by creating a class here. I’m going to create a class, let’s call it “class Runner”, just to give it a name, and I’m going to give this method which I’ll call “public void run”. Now let’s imagine that for some reason we want to pass a block of code to run, so we don’t want to pass in just strings, we want to actually pass a block of code.

How would you do that in previous versions of Java? Well, the answer is first you need to define an interface, let’s do that, let’s say “interface” and I’ll call this “Executable” and we need to give this interface a method, and this method would be a place where we put the code we want to run. Let’s create a method called “void execute”, just like that.

Now we can say that the runner accepts an object that implements the executable interface. I’ll just call it “e”. So its going to get something that implements this interface and its going to know that that object, whatever it is, has an execute method, so we can call that method, let’s put sysout in here and say “executing code block…” and let’s just call “e.execute()”.

Now to actually use this, so firstly we need an instance of this runner class, let’s say “Runner runner = new Runner” and then we can call the run method so let’s say “”.

Now in previous versions of Java, to actually pass it some block of code we’ve got to somehow have an object that implements this interface, and we can do that using an anonymous class syntax. In previous versions of Java, we can say here “new executable”, in this case. Open and close curly brackets and let’s implement the method that this interface specifies. So I’ll get rid of these lines that we don’t actually need and we can put some code in that to execute. Let’s say sysout “hello there”, so this is all Java 6 or 7 syntax
and if we now run this program, it says “hello there”.

So the whole point of this is just to pass in this code to this method and then this method can and do what it likes with it, and in this case it’s just outputting something and then it’s actually executing the code that we passed it in this method. So this is a lot of text purely just to specify this, so let’s have a look at how we can do that with Lambda Expressions in Java 8. I’m going to just put a bit of separator text here; let’s just put in like some equal signs.

By the way, “Lambda Expressions” apparently comes from mathematics where the Greek letter lambda has been historically associated with some kind of analogous situation, passing a function to a function, something like that.

So to use the Lambda Expression here we can say “”. So the same thing again; we’re calling this method and now again the challenge is to pass this method a block of code to execute, and we can pass this in a lot more elegantly with the Lambda Expression. We need two empty round brackets and an arrow. So it’s just an hyphen and a right angle bracket, and then the expression we want to run. So this bit here is the lambda expression. I’m going to just paste this up here because I’m going to make this code available on so you can refer back to it.

If you run this now, see, it does the same thing as this unwieldy syntax that we had in previous versions of Java. So it’s really important to keep in mind that all this is a block of code that this method is going to execute, and blocks of codes, of course, might have returned values and might also accept parameters …

Java 8 Tutorial | Creating The Database Class

Want all of our free Java training videos? Visit our Learning Library, which features all of our training courses and tutorials at

More details on this Java 8 training can be seen at This clip is one example from the complete course. For more free Java tutorials please visit our main website.

Java 8 Tutorial | Creating A Test Class

Want all of our free Java training videos? Visit our Learning Library, which features all of our training courses and tutorials at

More details on this Java 8 training can be seen at This clip is one example from the complete course. For more free Java tutorials please visit our main website.