Bind JList With database.
DefaultListModel dm=new DefaultListModel();
try
{
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3305/rms","root","root");
java.sql.PreparedStatement pst=con.prepareStatement("select * from raw");
ResultSet rs=pst.executeQuery();
while(rs.next())
{
String pc=rs.getString(1);
dm.addElement(pc);
}
jList1.setModel(dm);
}
catch(Exception e)
{
System.out.println(e);
}