-
Notifications
You must be signed in to change notification settings - Fork 0
/
Meanings.java
83 lines (73 loc) · 1.81 KB
/
Meanings.java
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package kamusi_proj;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.LinkedList;
/**
*
* @author HP
*/
public class Meanings {
LinkedList wordmeaning=new LinkedList();
LinkedList wordexample=new LinkedList();
LinkedList wordreference=new LinkedList();
public Meanings()
{
}
public Meanings(String mean,String ex,String ref)
{
wordmeaning.add(mean);
wordexample.add(ex);
wordreference.add(ref);
}
public void setMeaning(String m)
{
wordmeaning.add(m);
}
public void setExample(String ex)
{
wordexample.add(ex);
}
public void setReference(String re)
{
wordreference.add(re);
}
public LinkedList getWordMeaning()
{
return wordmeaning;
}
public LinkedList getWordExample()
{
return wordexample;
}
public LinkedList getWordReference()
{
return wordreference;
}
public int getlastref()
{
int last=1;
Connection con=null;
try
{
con=DBconnect.dbconnect();
String req="SELECT * FROM Mreferences ORDER BY rfid DESC LIMIT 1";
Statement st=con.createStatement();
ResultSet result=st.executeQuery(req);
while(result.next())
{
last=result.getInt("rfid");
}
}catch(Exception t)
{
t.printStackTrace();
}
DBconnect.connectclose(con);
return last;
}
}