Pessoal depois que eu faço o set de uma valor no método abaixo e tento pegar o método get por uma outra classe ele me retorna null…
public class utran {
public String Name;
*/
public void setName(String Name) {
this.Name = Name;
}
public String getName() {
return Name;
}
public static boolean gerar(String file) {
utran u = new utran();
classedao dao = new classedao();
String a= dao.Consultar(file); // daqui vai para minha classedao
JOptionPane.showMessageDialog(null, a);
String f = u.getName(); // depois de fazer o set na classe dao abaixo... ele me retorna null no get
[code]
public class classedao {
utran utran = new utran();
public String Consultar (String file){
String a= “”;
try{
Connection con = DataBaseCommands.getConnection(file);
java.sql.Statement stm = con.createStatement();
ResultSet rs = stm.executeQuery("SELECT * FROM [Plan1$] WHERE [Attribute Name]=‘teste’ ");
while (rs.next()){
a=rs.getString(1);
utran.setName(a);
System.out.println(utran.getName());
}[/code]