I have this class but I can not find the way to pass it to the mvc model, to work with the Setter and Getter and finally send the data to another class where a jLabel will receive it.
public class Clientes {
Connection conectando = null;
PreparedStatement preparando;
ResultSet resultado;
public void idclientes(){
Connection conectando=null;
PreparedStatement preparando;
ResultSet resultado;
conectando = Conectar.getConnection();
int j;
int cont=1;
String num="";
String c="";
String SQL="select max(idCliente) from clientesAlmacen";
try {
Statement st = conectando.prepareStatement(SQL);
ResultSet rs=st.executeQuery(SQL);
if(rs.next())
{
c=rs.getString(1);
}
if(c==null){
jLabel1.setText("CC0001");
}
else{
char r1=c.charAt(2);
char r2=c.charAt(3);
char r3=c.charAt(4);
char r4=c.charAt(5);
String r="";
r=""+r1+r2+r3+r4;
j=Integer.parseInt(r);
GenerarCodigos gen= new GenerarCodigos();
gen.generar(j);
jLabel1.setText("CC"+gen.serie());
}
} catch (SQLException ex) {
Logger.getLogger(NuevoCliente.class.getName()).log(Level.SEVERE, null, ex);
}
}
}