je suis en train d'écrire un programme en java mais j'ai un sérieux problème avec mes requêtes sql.
voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
 
import java.sql.*;
 
 
public class Abonne
{
	public Abonne(String id, String nom)
	{
		this.id_abonne = id;
		this.nom_abonne = nom;
	}
 
	public Abonne()
	{
 
	}
 
	public void enregistrerAbonne()
	{
		try
		{
			Statement state = new ConnectionBD().getConnection().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
			System.out.println("ok");
			ResultSet rset = state.executeQuery("select * from abonne");
			rset.moveToInsertRow();
			rset.updateString("id_abonne", this.id_abonne);
			rset.updateString("nom_abonne", this.nom_abonne);
			rset.insertRow();
			System.out.println("ok");
		}catch(Exception e)
		{
			System.out.println(e);
		}
 
	}
	public void supprimerabonne(String nom)
	{
		try{
			Statement state = new ConnectionBD().getConnection().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
			System.out.println("ok");
			ResultSet rset = state.executeQuery("select * from abonne where nom_abonne like "+nom+"");
			System.out.println("ok");
			rset.first();
			rset.deleteRow();
			System.out.println("propre");
		}catch(Exception e)
		{
			System.out.println(e);
		}
	}
 
	public static void main(String[] paramater)
	{
		new Abonne("542315","Coucou").supprimerabonne("Coucou");
 
	}
	private String id_abonne = null;
	private String nom_abonne = null;
}
 
import java.sql.*;
public class ConnectionBD 
{
	public ConnectionBD()
	{
		try
		{
			Class.forName("com.mysql.jdbc.Driver");
			connect = DriverManager.getConnection(url, user, passwrd);
		}catch(Exception e)
		{
			System.out.println(e);
		}
 
	}
 
	public Connection getConnection()
	{
		return this.connect;
	}
	private static Connection connect;
	private String url="jdbc:mysql://localhost:3306/test";
	private String user ="root";
	private String passwrd =null;
}
pardonner dites moi ce qui ne va pas dans ce code.