Temporada 0 Episodio 4: Modelos de instanciacion con Spring: Prototype y Singleton
Domingo Suarez Torres
SpringHispano.org-Screencast, aprende Spring Framework en tu idioma.
Temporada 0 Episodio 4: Modelos de instanciacion con Spring: Prototype y Singleton
Hola que tal, bienvenidos a los screencasts de Spring Hispano
Hello, how are you? Welcome to the Spring Hispano screencasts.
En esta ocasión vamos a continuar con la parte de acceso a datos con Spring
This time we are going to continue with the data access part with Spring.
Habíamos tenido algunos pequeños problemas para continuar con esta serie, pero bueno, estamos de vuelta
We had some small problems continuing with this series, but well, we are back.
La vez pasada nos quedamos en que íbamos a hacer un pequeño...
Last time we left off that we were going to make a little...
De hecho hicimos un ejercicio acerca de acceso a base de datos con Spring
In fact, we did an exercise about database access with Spring.
Y en esta ocasión lo que vamos a hacer es
And on this occasion what we are going to do is
Vamos a utilizar el código del screencast pasado, de hecho lo pueden revisar aquí en mi cuenta de github
We are going to use the code from the previous screencast, in fact, you can check it out here on my GitHub account.
github.com.domics
github.com.domics
SH screencast, es donde está el código de los screencasts que hemos estado haciendo
SH screencast, it's where the code for the screencasts we've been making is located.
El último código que hicimos fue en el cual pusimos la parte de JDBC con Spring
The last code we did was in which we included the JDBC part with Spring.
Y en esta ocasión lo que vamos a hacer es continuar y vamos a retomar este proyecto
And on this occasion, what we are going to do is continue and we are going to resume this project.
Yo ya subí aquí a github el código de este screencast, al menos la estructura base
I have already uploaded the code for this screencast to GitHub, at least the base structure.
Que está aquí en SH screencast, en screencast0003
That is here in SH screencast, in screencast0003.
Prácticamente es el que vamos a ocupar en este momento
It is practically the one we are going to use at this moment.
Muy bien, aquí en mi Spring Source Tool Suite lo que voy a hacer
Very well, here in my Spring Source Tool Suite what I am going to do
No me equivoqué
I was not mistaken.
Es traerme ese proyecto que ya está pre-construido, ya está pre-hecho
It's about bringing me that project that is already pre-built, it's already pre-made.
De hecho aquí sí es un Java Project
In fact, this is indeed a Java Project here.
Java, sí era un Java Project
Java, yes it was a Java Project.
Uy, equivoqué
Oops, I made a mistake.
Sí es un Java Project
Yes, it is a Java Project.
Aquí está, siguiente
Here it is, next.
Se llama screencast00x03
It is called screencast00x03.
Porque es el screencast 3 de la temporada 0
Because it is screencast 3 of season 0.
Y aquí lo voy a buscar en mi home
And here I'm going to look for it in my home.
Está en developer
It's in developer.
Bueno, en este caso es donde yo lo tengo, aquí
Well, in this case is where I have it, here.
Developer
Desarrollador
SH screencast
SH screencast
Y aquí está, screencast00x03
And here it is, screencast00x03.
Como ya está el punto classpad y el punto project
As the classpad point and the project point are already set.
Simplemente le digo seleccionar y le puedo dar finish
I simply tell you to select and I can give you finish.
Y con esto, bueno, lo que acabo de hacer es importar precisamente todos estos
And with this, well, what I just did is import all these.
Todo este proyecto que ya tenía hecho
All this project that I already had done.
Un error de Let's Decay de Android que no tengo bien configurado
A mistake from Let's Decay on Android that I haven't configured properly.
Todo este código que ya lo tenemos aquí arriba
All this code that we already have here above.
Bueno, pues lo acabamos de montar precisamente en screencast00x03
Well, we just set it up precisely in screencast00x03.
Y aquí está
And here it is.
Muy bien, ya está listo
Alright, it's ready.
¿Qué vamos a hacer?
What are we going to do?
Bueno, la vez pasada
Well, the last time
Les mostré un pequeño ejemplo
I showed them a small example.
Utilizando JDBC Template
Using JDBC Template
De hecho es este, jdbcejemplo.java
In fact, it is this, jdbcejemplo.java
En el cual, pues bueno, vamos a hacer un repaso rápido
In which, well, we are going to do a quick review.
Tenemos el driver class name, la url, el username
We have the driver class name, the URL, the username.
Tenemos el data source y el jdbc template
We have the data source and the JDBC template.
Pueden revisar el screencast anterior por si tienen alguna duda de todos estos componentes
You can review the previous screencast in case you have any questions about all these components.
Este era un programita que lo que hacía realmente era
This was a little program that really did
Primero, construir una tabla
First, build a table.
O sea, con el SQL es necesario para construir una tabla
I mean, with SQL it is necessary to build a table.
Y después hacer unos inserts en esa tabla
And then make some inserts in that table.
Y posteriormente al final hacer varias consultas
And later at the end make several inquiries.
Por ejemplo, haciendo
For example, doing
Queries para obtener un solo número en base a una consulta muy sencilla
Queries to obtain a single number based on a very simple query.
O por ejemplo, haciendo una consulta un poquito más elaborada
Or for example, making a slightly more elaborate query.
Utilizando los row mappers
Using the row mappers
Que bueno, vimos que de una manera muy sencilla se pueden ocupar esos row mappers
That's great, we saw that those row mappers can be used in a very simple way.
Muy bien, vamos a correr este ejemplito nada más
Very well, let's run this little example.
Para que vean que esto sigue funcionando
So that you can see that this is still working.
Ok
Ok
De tal manera que bueno
In such a way that good.
Podemos ver que pues este programa
We can see that this program...
Sigue siendo funcional
It remains functional.
También recordemos que, ¿Qué bases de datos estábamos ocupando?
Let's also remember, what databases were we using?
Pues estamos ocupando hypersonic
Well, we are using hypersonic.
Y hypersonic tiene un modelo bastante interesante de
And hypersonic has a quite interesting model of
En la cual se puede levantar que es
In which it can be raised that it is
Indicándole este tipo de url
Indicating this type of URL
Con eso se levanta de manera automática
With that, it automatically rises.
Y si necesitan más información sobre hypersonic
And if you need more information about hypersonic.
Pues bueno, pueden visitar
Well, you can visit.
El sitio web de
The website of
No, ese no es
No, that's not it.
H-C-S-Q-L-D-B.org
H-C-S-Q-L-D-B.org
En el cual bueno, pues ustedes aquí precisamente pueden ver
In which, well, you can precisely see here.
Muchísima más información acerca de hypersonic
A lot more information about hypersonic.
Muy bien
Very good
Ahora sí, vamos a continuar con nuestro ejercicio
Now, let's continue with our exercise.
Lo que vamos a hacer el día de hoy es
What we are going to do today is
De hecho la vez pasada lo único que jugamos de Spring fue precisamente el JVS Template
In fact, the last time we played with Spring, the only thing we used was the JVS Template.
Y lo que vamos a hacer a continuación
And what we are going to do next
Es utilizar la configuración de XML de Spring
It is to use the XML configuration of Spring.
Para que todo esto quede igualmente funcional
So that all of this remains equally functional.
Funcionando de manera muy sencilla
Working in a very simple way
Para eso vamos a crear un archivo de
For that, we are going to create a file of
Un archivo de configuración de Spring
A Spring configuration file.
Un Spring Bean Configuration File
A Spring Bean Configuration File
Que no es más que un XML
It is nothing more than an XML.
Y vamos a ponerle a este
And we're going to name this one
DataSourceContext.xml
DataSourceContext.xml
Puede ser el nombre que ustedes gusten
It can be the name you like.
Ok
Okay
¿Qué le voy a poner aquí?
What am I going to put here?
Nada más
Nothing else.
La de Beans
The one from Beans
¿Qué más?
What else?
Nada más
Nothing more.
Hay cosas muy interesantes
There are very interesting things.
Por ejemplo, hay un esquema para JDBC
For example, there is a scheme for JDBC.
Que bueno, no lo vamos a ver hoy
How good, we are not going to see it today.
Yo creo que lo podremos ver en otra ocasión con más calma
I believe we will be able to see it on another occasion with more calm.
Solamente el día de hoy vamos a poner Beans
Only today are we going to put Beans.
Context
Context
Y
And
Vamos a ver el de Utilería
Let's see the props one.
También vamos a poner el de Utilería
We will also put the props one.
Ese nos va a servir bastante el día de hoy
That is going to help us a lot today.
Obviamente el de Spring 3
Obviously the one from Spring 3.
Marcamos Spring 3
We mark Spring 3.
El de Context
The one from Context
Marcamos Spring 3
We mark Spring 3
Y Beans
And Beans
Igual marcamos el de Spring 3
We still mark the Spring 3 one.
Le damos Next
We give it Next.
Finish
Finish
Bien, pues nada más terminó
Well, as soon as it finished.
E hizo este XML
And he made this XML.
Muy bien
Very good
¿Qué vamos a hacer en este XML?
What are we going to do in this XML?
Bueno, pues lo primero que vamos a hacer es configurar
Well, the first thing we are going to do is set up.
En DataSource
In DataSource
Ok
Okay
Y vamos a hacer un Bean
And we are going to make a Bean.
Que se va a llamar
What is it going to be called?
DataSource
DataSource
Ok
Ok
Ahora
Now
, en el ejemplo pasado
In the previous example.
De hecho, ocupamos un DataSource
In fact, we use a DataSource.
De
Of
Del proyecto de Commons
From the Commons project
De BCP
From BCP
Yo creo que en esta ocasión vamos a usar el mismo
I believe that this time we are going to use the same one.
¿De acuerdo?
Okay?
Basic DataSource
Basic DataSource
Muy bien
Very well
Ok
Ok
Ahora, este DataSource necesita
Now, this DataSource needs
Necesita el Driver ClassName, ok?
You need the Driver ClassName, okay?
De hecho, el Driver ClassName
In fact, the Driver ClassName
Podemos dejarlo todo en una sola línea y borramos todo esto
We can put it all in one line and erase all of this.
No nos sirve
It's not useful to us.
¿Qué más necesitamos?
What else do we need?
Necesitamos, este...
We need, um...
El...
The...
La URL, por ejemplo
The URL, for example
Valor
Value
Cerramos el Tag
We close the Tag.
Y, aparte, vamos a necesitar el Username
And, besides, we will need the Username.
Username
Username
Y también vamos a necesitar el Password
And we are also going to need the password.
Básicamente es todo lo que vamos a necesitar
Basically, that's all we are going to need.
Ahora, el DataSource
Now, the DataSource
Bueno, ya sabemos cuál
Well, we already know which one.
Perdón, el Driver ClassName
Sorry, the Driver ClassName
Ya sabemos cuál es
We already know what it is.
Es este Driver ClassName
Is this Driver ClassName?
Se lo ponemos
We put it on for you.
La URL
The URL
También ya la sabemos
We already know it too.
La tenemos aquí del ejemplo anterior
We have it here from the previous example.
Ok
Ok
Y el Username es
And the Username is
S-A
S-A
Y el Password es vacío
And the password is empty.
Muy bien
Very well
Con eso ya tenemos nuestro DataSource
With that we already have our DataSource.
Ahora vamos a configurar un BIM
Now we are going to set up a BIM.
Que nos va a servir
That will help us.
Para, este...
For, um...
Tener nuestro Template
Have our Template
De...
From...
JDBC
JDBC
JDBC Template
JDBC Template
Ahí está
There it is.
Ahora, este...
Now, um...
No recuerdo si...
I don't remember if...
Aquí está el DataSource
Here is the DataSource.
Y el DataSource que va a ocupar
And the DataSource that it will use.
Pues es el que está allá arriba
Well, it's the one up there.
¿De acuerdo?
Okay?
Ahí estamos haciendo la inyección
There we are giving the injection.
¿De acuerdo?
Okay?
Por Zeter
By Zeter
Muy bien
Very well
¿Qué más vamos a necesitar?
What else are we going to need?
Tenemos el DataSource
We have the DataSource.
Tenemos el JDBC Template
We have the JDBC Template.
Y prácticamente es todo lo que necesitamos
And that's basically all we need.
Ahora, vamos a crear una clase
Now, let's create a class.
Que se va a llamar
What is it going to be called?
Este...
This...
Prueba
Test
Así, vamos a ponerle Prueba
So, let's call it a Test.
Y vamos a ponerla en otro paquete
And we are going to put it in another package.
Vamos a ponerle así
Let's put it this way.
Vamos a dejarla tal cual
Let's leave it as is.
Y vamos a ponerle un MetaDomain
And we're going to give it a MetaDomain.
Este MetaDomain tiene un...
This MetaDomain has a...
Vamos a configurar el ApplicationContext de Spring
Let's configure the Spring ApplicationContext.
¿De acuerdo?
Agreed?
¿Se acuerdan cuál ocupamos?
Do you remember which one we used?
Un ClassPath
A ClassPath
XMLApplicationContext
XMLApplicationContext
Y que recibe como parámetro
And what it receives as a parameter.
El nombre del archivo XML
The name of the XML file
Está en
It is in
DataSourceContext.xml
DataSourceContext.xml
Muy bien
Very well
Ahora lo que vamos a hacer es pedirle al Context
Now what we are going to do is ask the Context.
Context.getbin
Context.getbin
Que nos dé el JDBC Template
Let the JDBC Template give us.
Aquí un Shortcut
Here’s a Shortcut.
Lo asignamos a una nueva variable
We assign it to a new variable.
Y este es el JDBC Template
And this is the JDBC Template.
Listo
Ready
Sin ningún problema
No problem at all.
Ahora me voy a traer el código
Now I'm going to get the code.
De mi ejemplo anterior
From my previous example
De hecho podría traerme prácticamente todo
In fact, it could bring me practically everything.
Pero es que...
But it's just that...
¿Qué les parece si nada más hago una consulta ahorita?
How about I just make a query right now?
¿De acuerdo?
Okay?
Solamente esto
Only this
Por el momento
For the moment.
Aquí obviamente cambia
Here it obviously changes.
Porque aquí utilizo la variable
Because I use the variable here.
Muy bien
Very well
Y con eso sería más que suficiente
And that would be more than enough.
De hecho
In fact
Runas, Java Application
Runes, Java Application
Corre, corre, corre, corre, corre
Run, run, run, run, run.
Ahí está
There it is.
Existen dos personas en la base de datos
There are two people in the database.
Esto es porque, bueno, yo ya tenía aquí datos guardados
This is because, well, I already had data saved here.
Tengo que actualizar aquí
I need to update here.
Se le va a dar un clic aquí
You will click here.
Se le va la onda
He/She is losing focus.
Yo ya tenía datos aquí
I already had data here.
De hecho está...
In fact, it is...
Tengo dos registros
I have two records.
Pero podría agregar otro
But I could add another one.
Otro registro
Another record
Y de hecho aquí también me voy a traer este...
And in fact, I'm also going to take this...
Me voy a traer el query
I'm going to bring the query.
Así
Like this
Y también donde...
And also where...
Aquí me lo voy a traer
I’m going to bring it here.
A este lado
This side
Y vamos a poner...
And we are going to put...
Obviamente aquí cambia
Obviously, things change here.
Y vamos a poner...
And let's put...
Rodríguez
Rodriguez
Jorge, que tiene el ID 3
Jorge, who has the ID 3
Esto lo voy a poner después
I'm going to put this later.
De hecho esto va a fallar
In fact, this is going to fail.
Cada vez
Every time
Bueno, la primera vez va a funcionar
Well, the first time it's going to work.
Después va a fallar
Then it’s going to fail.
Ahí está, tres personas en la base de datos
There it is, three people in the database.
Si yo corro, no, el programa va a fallar
If I run, no, the program will fail.
Porque va a intentar
Because he/she is going to try.
Insertar de nuevo a Jorge Rodríguez
Reinsert Jorge Rodríguez.
Con el ID 3
With ID 3
Y obviamente no lo va a dejar
And obviously, he/she is not going to let it go.
Porque es la llave primaria
Because it is the primary key.
Entonces ahí algo falló
So something went wrong there.
De acuerdo
Okay.
De hecho este update
In fact, this update
Si yo le cambio, por ejemplo
If I change it, for example
A ver, vamos a ver aquí
Let's see here.
Vamos a ver el script
Let's see the script.
Aquí está
Here it is.
Ah, recuerdan
Ah, they remember.
No, no falló
No, it didn't fail.
Porque si recuerdan el screencast pasado
Because if you remember the last screencast.
Al final yo les mencionaba
In the end, I mentioned to them.
Que tenían que ejecutar esta instrucción
That they had to execute this instruction.
Si ustedes no ejecutaron esta instrucción
If you did not carry out this instruction
Hypersonic no se cierra de manera adecuada
Hypersonic does not close properly.
Y no da flush
And it doesn't flush.
De los cambios
Of the changes
Que ustedes hayan hecho
That you have done.
Por eso ahorita no funcionó
That's why it didn't work right now.
Pero bueno
But well
En esta ocasión ya va a funcionar
This time it is going to work.
Ahí están las tres personas
There are the three people.
Y ahora sí va a tronar
And now it's really going to thunder.
Como chingampina
Like a chingampina.
Perfecto
Perfect
Y está tronando precisamente
And it’s thundering right now.
Porque el ID 3 ya existía
Because ID 3 already existed.
En la tabla
In the table
Vamos a darle un refresco aquí
Let's get a soda here.
Abrimos el demo.script
We open the demo.script.
Y aquí está Jorge Rodríguez con el ID 3
And here is Jorge Rodríguez with ID 3.
Muy bien
Very good
Ok, como ustedes se podrán haber dado cuenta
Okay, as you may have noticed.
Hacer esto con Spring fue muy sencillo
Doing this with Spring was very simple.
Lo único que necesitamos
The only thing we need.
Configurar fue el data source
Configure the data source.
Y el JDBC template
And the JDBC template.
Pero esto nos lleva a un pequeño
But this brings us to a small
Problema que es
What problem is it?
Oye, tú aquí en Duro
Hey, you here in Duro.
Tienes el driver
Do you have the driver?
Tienes la URL, el username y el password
You have the URL, the username, and the password.
¿Cómo podemos solucionar el problema
How can we solve the problem?
De que esto sea configurable
That this is configurable.
O un poquito más configurable?
Or a little more configurable?
Vamos a hacer un archivo de configuración
Let's create a configuration file.
Ok, vamos a llamarle
Okay, let's call him.
JDBC.properties
JDBC.properties
Aquí en resources
Here in resources
Ahí está nuestro properties
There is our properties.
Y vamos a ponerle driver
And we are going to add a driver.
Igual
Same
Vamos a traernos todo esto
Let's take all of this with us.
El driver class name
The driver class name
Es igual a esto
It is the same as this.
La URL
The URL
Es igual a esto de acá
It's the same as this over here.
El username
The username
Es igual a esto que está aquí
It is the same as this that is here.
Y hacemos lo mismo con el password
And we do the same with the password.
Muy bien
Very well
Listo
Ready
Ahora, ¿Cómo le hacemos para cargar estos archivos?
Now, how do we upload these files?
Estos datos del archivo de configuración
These data from the configuration file.
En el XML
In the XML
Bueno, muy sencillo
Well, very simple.
Spring tiene por aquí
Spring is around here.
El esquema de utilería
The utility scheme
Ok
Okay
Que me permite a mí
What allows me
Este
This
De hecho no está en el de utilería
In fact, it is not in the props.
Está en el de context
It is in the context.
En el property placeholder
In the property placeholder
Es este
It is this.
Y esto
And this
Lo que necesita
What you need
Este bin
This bin
La idea de este bin
The idea of this bin
Es que tú puedas definir
It's that you can define.
En un archivo properties
In a properties file
Ciertos valores
Certain values
Tal cual lo acabamos de hacer acá
Just as we just did here.
Y este property placeholder
And this property placeholder
Configurer
Configure
Lo que va a hacer
What you are going to do.
Es sustituir
It is to substitute.
Los valores del
The values of the
Del
Of the
Del archivo de configuración
From the configuration file
En el XML
In the XML
Y eso se hace muy sencillo
And that becomes very easy.
Simplemente
Simply
Indicándolo de la siguiente manera
Indicating it in the following way
¿Ven?
Do you see?
Signo de pesos
Dollar sign
URL
URL
Signo de pesos llaves
Dollar sign keys
Y aquí
And here
Username
Nombre de usuario
Signo de pesos
Dollar sign
Password
Contraseña
De esta manera
In this way
Si nosotros en algún momento
If we at any moment
Quisiéramos cambiar la configuración
We would like to change the settings.
De la base datos
From the database
Solamente tenemos que venir
We just have to come.
Al archivo de propiedades
To the properties file
En vez de modificar
Instead of modifying
El archivo de configuración de Spring
The Spring configuration file
Y eso nos da un poquito
And that gives us a little bit.
Más flexibilidad
More flexibility
Vamos a correr de nuevo
Let's run again.
Nuestro programa
Our program
Pero obviamente aquí
But obviously here
Voy a quitar
I'm going to remove.
El insert
The insert
De Jorge Rodríguez
By Jorge Rodríguez
Si no va a fallar
If it is not going to fail.
Y aquí
And here
Corro la prueba
I run the test.
Y ahí está
And there it is.
Perfecto
Perfect
Entonces
So
Como se podrán haber dado cuenta
As you may have noticed
En este
In this
En este ejercicio
In this exercise
Lo que hicimos fue
What we did was
Cómo configurar
How to configure
El data source
The data source
Con XML
With XML
De Spring
Of Spring
En JBS template
In JBS template
Cómo configurarlo
How to set it up
Cómo utilizar
How to use
El property placeholder
The property placeholder
Que es muy sencillo de utilizar
That it is very easy to use
Y aparte muy
And besides very
Como se podrán haber dado cuenta
As you may have noticed
Es muy
It is very
Cómodo de utilizar
Easy to use
Porque
Because
Después del programa
After the program
El mantenimiento
The maintenance
Se reduce a
It reduces to
A escribir
To write
O a modificar
Or to modify.
Los properties
The properties
Y cómo se usa
And how is it used?
Muy sencillo
Very simple
Instancia es el application context
Instance is the application context.
O de alguna manera
Or somehow
Tú creas
You create
El application context
The application context
Le pides al application context
You ask for the application context.
El bin
The bin
De tipo
Of type
JBS template
JBS template
Ya que tienes la instancia
Since you have the instance
Ya puedes trabajar con él
You can now work with him.
Bueno
Good.
Espero les haya gustado
I hope you liked it.
Esto fue muy breve
This was very brief.
Nada más quería mostrar
I just wanted to show.
Este caso
This case
Muy específico
Very specific
Particular
Particular
En breve
In short
Les haremos
We will make them.
Otra
Another
Otra demostración
Another demonstration
Un poquito más elaborada
A little more elaborate.
De acceso a datos
Data access
Con Spring
With Spring
Ya para terminar
Just to finish up.
Algo que me agrada muchísimo
Something that I really like.
De esto
Of this
Es que
It's just that
Cuando ustedes están
When you are
Programando con Spring
Programming with Spring
Utilizando este enfoque
Using this approach
Ustedes solamente
You only.
Se preocupan por
They care about
Ocupar el JBS template
Use the JBS template.
Vean como nunca manejamos
Look at how we never drive.
Excepciones
Exceptions
Si ocurren excepciones
If exceptions occur.
De hecho como
In fact, I eat.
Pasó hace un momento
It happened a moment ago.
Que
What
Hubo una excepción
There was an exception.
De
From
Violación de restricción
Violation of restriction
O de integridad
Or of integrity
En la base de datos
In the database
¿Sale?
Is it okay?
Lo que me gusta de Spring
What I like about Spring
Es que Spring
It's just that Spring.
Te genera una estructura
It generates a structure.
Muy interesante
Very interesting
De excepciones
Of exceptions
De hecho nosotros
In fact we
Podríamos
We could.
Voy a preparar este código
I am going to prepare this code.
Para que
For what
A ustedes les sea más sencillo
So that it is easier for you.
Y lo vean mejor
And they see it better.
Antes de irnos
Before we leave
Ok
Okay
Y esto le voy a dar
And this I'm going to give you.
Un duplicate
A duplicate.
Key exception
Key exception
Simplemente voy a ponerle
I'm just going to put it on you.
Aquí el mensaje
Here is the message.
Ya existe
It already exists.
El ID
The ID
En la base de datos
In the database
¿Sale?
Are you in?
De todas maneras
In any case.
Digo que no estoy
I say that I am not.
Aquí estoy previniendo
Here I am preventing.
Que aquí hay una excepción
That there is an exception here.
De llave duplicada
Of duplicated key
De hecho es lo que está pasando
In fact, that is what is happening.
Algo que me agrada mucho
Something that pleases me a lot.
De Spring
From Spring
Es que
It's just that
Spring te va a envolver
Spring is going to envelop you.
Las excepciones
The exceptions
De SQL
From SQL
Las SQL
The SQL
Las SQL exception
The SQL exception
Perdón
Sorry
Que son de tipo
What are they like?
Checked
Checked
Las va a convertir
He/She is going to convert them.
En una runtime
In a runtime
Que es duplicate
What is duplicate?
Key exception
Excepción clave
De hecho
In fact
Esta excepción
This exception
Es hija de
She is the daughter of
De
From
De una excepción
Of an exception
Que se llama
What is it called?
Data access exception
Data access exception
Que también es runtime
That is also runtime.
De tal manera
In such a way
Que ustedes no tienen
That you do not have.
Que manejar las excepciones
To handle exceptions
En este caso
In this case
Bueno
Good
Yo
I
Muy particularmente
Very particularly
Yo si quiero manejar
I do want to drive.
Los casos
The cases
De llaves duplicadas
Of duplicate keys
Y
And
De tal manera
In such a way
Que solamente me dice
That only tells me
Oye ya existe
Hey, it already exists.
Tal idea en la base de datos
Such idea in the database.
Ok
Okay
Muy bien
Very good
Pues espero les haya gustado
Well, I hope you liked it.
Yo creo que ustedes
I believe that you all
Pueden practicar
You can practice.
En sus casas
In their houses.
Poniendo
Putting
O convirtiendo
Or converting
Todo el programa
The whole program
Que hicimos
What did we do?
El screencast
The screencast
Pasado
Past
O sea
That is to say
Todo el código
All the code
Que está aquí
What is here
En JDBC
In JDBC
Ejemplo
Example
Lo pueden mandar
They can send it.
A utilizarlo
To use it
Con Spring
With Spring
Va a ser muy sencillo
It's going to be very easy.
De hecho prácticamente
In fact, practically
Es el mismo código
It's the same code.
Pero bueno
But well
Eso les puede servir
That can be useful for them.
Para que
For what
Practiquen un poquito
Practice a little bit.
Muy bien
Very good
Pues eso será todo
Well, that will be all.
Les agradezco mucho
I thank you very much.
La atención
The attention
Y pues seguimos en contacto
And well, we keep in touch.
Muchas gracias
Thank you very much.
Hasta luego
See you later.
Continue listening and achieve fluency faster with podcasts and the latest language learning research.