Skip to content

Commit

Permalink
Merge pull request #19 from CodeStrong2023/java_semana1_GiulianaDiaz
Browse files Browse the repository at this point in the history
Sistema de estudiante en Java
  • Loading branch information
repogiu authored Aug 31, 2024
2 parents 5ff3798 + f1778b8 commit 3ea9972
Show file tree
Hide file tree
Showing 10 changed files with 646 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Metodología/Java/Sistema Estudiantes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions Metodología/Java/Sistema Estudiantes/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Metodología/Java/Sistema Estudiantes/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Metodología/Java/Sistema Estudiantes/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions Metodología/Java/Sistema Estudiantes/.idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Metodología/Java/Sistema Estudiantes/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>UTN</groupId>
<artifactId>estudiante</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
<!-- https://mvnrepository.com/artifact/com.mysql/mysql-connector-j -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>

</dependencies>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package UTN.conexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexion {
public static Connection getConnection(){
Connection conexion = null;
// Variables pra conectarnos ala base de datos
var baseDatos = "estudiantes";
var url = "jdbc:mysql://localhost:3306/" + baseDatos;
var usuario = "root";
var password = "ADMIN";

// cargamos la clase del driver de mysql en memoria
try {
Class.forName("com.mysql.cj.jdbc.Driver");
conexion = DriverManager.getConnection(url, usuario, password);
} catch (ClassNotFoundException | SQLException e){
System.out.println("Ocurrio un error en la conexion: " + e.getMessage());
} // Fin catch
return conexion;
} // Fin metodo Connection
}
Loading

0 comments on commit 3ea9972

Please sign in to comment.