String sqlstring ="select host,port,username
,password,LastCrawlState from HostTable where id ="+id;
System.out.println(sqlstring);
rs = stmt.executeQuery(sqlstring);

The result is :

select host,port,username,password,LastCrawlState from HostTable where
id =1
Exception in thread "main" java.lang.NullPointerException
at Host.<init>(Host.java:65)
at TestTwo.main(TestTwo.java:9)

but the same Query I executed in mysql Query Brower had the right
answer ,why?

select host,port,username,password,LastCrawlState from HostTable where
id =1