Base de données INSA
This commit is contained in:
parent
85d3994d90
commit
d91a67fa86
13 changed files with 93 additions and 20 deletions
11
Implementation/bin/.classpath
Normal file
11
Implementation/bin/.classpath
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path=""/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="mysql-connector-java-8.0.22.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
1
Implementation/bin/.gitignore
vendored
Normal file
1
Implementation/bin/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/bin/
|
17
Implementation/bin/.project
Normal file
17
Implementation/bin/.project
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Implementation</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
10
Implementation/bin/.settings/org.eclipse.jdt.core.prefs
Normal file
10
Implementation/bin/.settings/org.eclipse.jdt.core.prefs
Normal file
|
@ -0,0 +1,10 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=13
|
||||
org.eclipse.jdt.core.compiler.compliance=13
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=13
|
BIN
Implementation/bin/src/images/Home.png
Normal file
BIN
Implementation/bin/src/images/Home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
Implementation/bin/src/images/Logo.png
Normal file
BIN
Implementation/bin/src/images/Logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
7
Implementation/chatapp/.classpath
Normal file
7
Implementation/chatapp/.classpath
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="lib" path="gradle/wrapper/gradle-wrapper.jar"/>
|
||||
<classpathentry kind="output" path="build/classes/java/main"/>
|
||||
</classpath>
|
17
Implementation/chatapp/.project
Normal file
17
Implementation/chatapp/.project
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>chatapp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
1
Implementation/chatapp/build/classes/java/main/.gitignore
vendored
Normal file
1
Implementation/chatapp/build/classes/java/main/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/chatapp/
|
|
@ -1,7 +1,12 @@
|
|||
chatapp/Launcher.java
|
||||
chatapp.Launcher
|
||||
chatapp/View/ConnexionScreen.java
|
||||
chatapp.View.ConnexionScreen
|
||||
chatapp/Protocol/RunnerEcouteTCP.java
|
||||
chatapp.Protocol.RunnerEcouteTCP
|
||||
chatapp/View/DemarrerSession.java
|
||||
chatapp.View.DemarrerSession
|
||||
chatapp/View/FenetreSession.java
|
||||
chatapp.View.FenetreSession
|
||||
chatapp.View.FenetreSession$1
|
||||
chatapp/Controller/ChatApp.java
|
||||
chatapp.Controller.ChatApp
|
||||
chatapp/Model/DataBase.java
|
||||
|
@ -10,8 +15,6 @@ chatapp/View/ChangementPseudo.java
|
|||
chatapp.View.ChangementPseudo
|
||||
chatapp/Protocol/RunnerEcouteUDP.java
|
||||
chatapp.Protocol.RunnerEcouteUDP
|
||||
chatapp/Launcher.java
|
||||
chatapp.Launcher
|
||||
chatapp/Model/ListUtilisateurs.java
|
||||
chatapp.Model.ListUtilisateurs
|
||||
chatapp/Protocol/UDPEchange.java
|
||||
|
@ -21,19 +24,16 @@ chatapp/Model/MessageHorodate.java
|
|||
chatapp.Model.MessageHorodate
|
||||
chatapp/Main.java
|
||||
chatapp.Main
|
||||
chatapp/View/View_Menu.java
|
||||
chatapp.View.View_Menu
|
||||
chatapp/View/Clavardage.java
|
||||
chatapp.View.Clavardage
|
||||
chatapp.View.Clavardage$1
|
||||
chatapp/Protocol/SessionClavardage.java
|
||||
chatapp.Protocol.SessionClavardage
|
||||
chatapp/View/ConnexionScreen.java
|
||||
chatapp.View.ConnexionScreen
|
||||
chatapp/View/View_Utilisateurs.java
|
||||
chatapp.View.View_Utilisateurs
|
||||
chatapp/Model/Utilisateur.java
|
||||
chatapp.Model.Utilisateur
|
||||
chatapp/View/FenetreSession.java
|
||||
chatapp.View.FenetreSession
|
||||
chatapp.View.FenetreSession$1
|
||||
chatapp/View/Clavardage.java
|
||||
chatapp.View.Clavardage
|
||||
chatapp.View.Clavardage$1
|
||||
chatapp/View/View_Menu.java
|
||||
chatapp.View.View_Menu
|
||||
chatapp/View/DemarrerSession.java
|
||||
chatapp.View.DemarrerSession
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.sql.*;
|
|||
* </p>
|
||||
*/
|
||||
public class DataBase {
|
||||
private final String DBurl = "jdbc:mysql://srv-bdens.insa-toulouse.fr:3306" ;
|
||||
private final String DBurl = "jdbc:mysql://srv-bdens.insa-toulouse.fr:3306/tp_servlet_006?" ;
|
||||
private Connection connection = null;
|
||||
private final String login = "tp_servlet_006";
|
||||
private final String pswd = "baePh9ei";
|
||||
|
@ -54,8 +54,8 @@ public class DataBase {
|
|||
// Nabil : DECOMMENTER CETTE LIGNE
|
||||
//this.connection = DriverManager.getConnection("jdbc:mysql://localhost/POO_AL_NM?allowPublicKeyRetrieval=true&useSSL=false", "root", "1234");
|
||||
// Auriane : DECOMMENTER CETTE LIGNE
|
||||
this.connection = DriverManager.getConnection("jdbc:mysql://localhost:8889/POO_AL_NM?allowPublicKeyRetrieval=true&useSSL=false", "root", "root");
|
||||
//this.connection = DriverManager.getConnection(this.DBurl,login,pswd);
|
||||
//this.connection = DriverManager.getConnection("jdbc:mysql://localhost:8889/POO_AL_NM?allowPublicKeyRetrieval=true&useSSL=false", "root", "root");
|
||||
this.connection = DriverManager.getConnection(this.DBurl,login,pswd);
|
||||
System.out.println("Connexion Etablie");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -460,7 +460,13 @@ public class DataBase {
|
|||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
existe = (!rs.equals(null));
|
||||
try {
|
||||
if(rs.next()){
|
||||
existe = (!rs.equals(null));
|
||||
}
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
return existe;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ public class Utilisateur {
|
|||
private final InetAddress ip ;
|
||||
private final String id ;
|
||||
|
||||
Integer TAILLE_MAX = 5;
|
||||
/**
|
||||
* Constructeur : Utilisateur
|
||||
* @param pseudo Le pseudo associe
|
||||
|
@ -27,7 +28,10 @@ public class Utilisateur {
|
|||
this.setPseudo(pseudo) ;
|
||||
this.setPort(port);
|
||||
this.ip = ip ;
|
||||
this.id = ip.getHostName() ;
|
||||
String aux= ip.getHostName() ;
|
||||
if(aux.length() > TAILLE_MAX)
|
||||
aux = aux.substring(0, TAILLE_MAX);
|
||||
this.id = aux ;
|
||||
}
|
||||
|
||||
public String getPseudo() {
|
||||
|
|
|
@ -59,7 +59,6 @@ public class SessionClavardage extends Thread {
|
|||
}
|
||||
this.derniersMsg = new ArrayList<MessageHorodate>();
|
||||
this.pcs = new PropertyChangeSupport(this);
|
||||
this.app.getDb().CreationTableHistorique("Doudou","Marvel");
|
||||
this.start();
|
||||
Platform.runLater( () ->
|
||||
new FenetreSession(this)
|
||||
|
|
Loading…
Reference in a new issue