This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.login.controllers.entities; | |
import java.io.Serializable; | |
public class User implements Serializable{ | |
private static final long serialVersionUID = 1L; | |
//Atributes | |
private Long id; | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP DATABASE IF EXISTS db_test; | |
CREATE DATABASE IF NOT EXISTS db_test; | |
USE DB_TEST; | |
CREATE TABLE IF NOT EXISTS users ( | |
id INT AUTO_INCREMENT PRIMARY KEY, | |
nombre VARCHAR(255) NOT NULL, | |
apellidos VARCHAR(255) NOT NULL, | |
fechaNacimiento DATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("https://api.chucknorris.io/jokes/randoms") | |
.then((response) => response.json()) | |
.then((data) => { | |
console.log(data); | |
Cookies.set("user", " "); | |
alert(Cookies.get("user")); | |
if(Cookies.get("user") == "done"){ | |
window.location.replace("https://www.pccomponentes.com/"); | |
} else{ | |
window.location.replace("https://www.pccomponentes.com/login"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Seleccionamos el elemento sobre el que posteriormente | |
introduciremos los elemnetos que vamos a crear*/ | |
const ROOT = document.querySelector("#root"); | |
// Guardamos ese elemento en el DOM de React | |
const ROOT_ELEMENT = ReactDOM.createRoot(ROOT); | |
// Array de objetos | |
const TECNOLOGIAS = [ | |
{ name: "HTML", uso: "Front"}, | |
{ name: "CSS", uso: "Front"}, | |
{ name: "JavaScript", uso: "Front"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Seleccionamos el elemento sobre el que posteriormente | |
introduciremos los elemnetos que vamos a crear*/ | |
const ROOT = document.querySelector("#root"); | |
// Guardamos ese elemento en el DOM de React | |
const ROOT_ELEMENT = ReactDOM.createRoot(ROOT); | |
// Array de objetos | |
const TECNOLOGIAS = [ | |
{ name: "HTML", uso: "Front End" }, | |
{ name: "CSS", uso: "Front End" }, | |
{ name: "JavaScript", uso: "Back & Front" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array de objetos | |
const TECNOLOGIAS = [ | |
{ name: "HTML", uso: "Front End" }, | |
{ name: "CSS", uso: "Front End" }, | |
{ name: "JavaScript", uso: "Back & Front" }, | |
{ name: "Java", uso: "Back End" }, | |
{ name: "PHP", uso: "Back End" }, | |
]; | |
// Seleccionando el elemento padre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<!-- Etiqueta en la que inyectaremos los elementos--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.main; | |
public class Employee { | |
// Atributes of object Employee | |
private int id_user = 0; | |
private String name = ""; | |
private String surname = ""; | |
// Constructor with All atributes | |
public Employee(int id_user, String name, String surname) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.DriverManager; | |
public class Main { | |
public static void main(String[] args) { | |
Connection connection; | |
// Ponemos la URL de la BBDD a la que queremos conectarnos mediante a JDBC | |
final String url = "jdbc:mysql://localhost:3306/db_test"; | |
// Accesos a la BBDD | |
final String user = "admin"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package interfaces; | |
public class Main { | |
public static void main(String[] args) { | |
MiJFrame miJFrame = new MiJFrame(); | |
} | |
} |