im new to java so if im doing some thing the wrong way please let me know
this is the class that connects to data base and grabs all the info from colum 1
and colum 2 that part works
now when i try to either make it a useable list either by making it a vector or arraylist it gives me a error because coloum two is all data not just numbers any help is appreciated
this is the part of my code that works i took out the other stuff
import java.util.*;
import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class connector {
public static void main(String[] args) {
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
String url = "****";
String user = "****";
String password = ****";
try {
con = DriverManager.getConnection(url, user, password);
pst = con.prepareStatement("SELECT * FROM `custom`");
rs = pst.executeQuery();
while (rs.next()) {
System.out.print(rs.getInt(1));
}
} catch (SQLException ex) {
Logger lgr = Logger.getLogger(connector.class.getName());
lgr.log(Level.SEVERE, ex.getMessage(), ex);
} finally {
try {
if (rs != null) {
rs.close();
}
if (pst != null) {
pst.close();
}
if (con != null) {
con.close();
}
} catch (SQLException ex) {
Logger lgr = Logger.getLogger(connector.class.getName());
lgr.log(Level.WARNING, ex.getMessage(), ex);
}
}
}
}