package ...
import com.project.Global;
import com.wp.tier1.*;
import com.wp.util.*;
import java.sql.*;
public class DealerList implements java.io.Serializable {
public
String ListOfDealer;
public DealerList() {}
public String getDealers() throws DataLayerException
{
Connection Connection = null;
Connection = ConnectionFactory.getConnection();
synchronized(Connection)
{
try
{
Statement Statement = Connection.createStatement();
ResultSet rs = Statement.executeQuery("SELECT customernumber, company, name, shipcity, shipstate FROM dealer WHERE authorized=20 order by company");
String city="";
while (rs.next())
{
if(rs.getString(4) != null){city = rs.getString(4);}
ListOfDealer = ListOfDealer + "<option value=" + rs.getString(1) + ">"+ rs.getString(2) +","+ rs.getString(3) +","+ city +","+ rs.getString(5) + "</option>";
}
if (rs !=null) rs.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
return ListOfDealer;
}
public String getDealerList() {
return ListOfDealer;
}
}