Tag Archives: oop

Postgresql java infinite loop when connecting

Questions: I have the following code to connect postgresql database via java but when I run this code, it always end up in infinite loop at the getConnection line. How can I handle this? public static void main(String[] args) { try { Class.forName(“org.postgresql.Driver”); Connection conn = DriverManager.getConnection(“jdbc:postgresql://localhost:533/Airway”,”postgres”, “abc”); PreparedStatement stmt = conn.prepareStatement(“select * from user”);… Read More »

Predicate is not working in Foreach loop it is taking the latest one

Questions: var cpaclassids = FetchProductTypes(ids); var temp = cpaclassids; var query = (from x in partJoinTableRepository.GetPartJoinQuery() join y in partRepository.GetPartsQuery() on x.PartId equals y.Id join z in partProductTypeReposiotry.GetPartProductTypesQuery() on x.PartId equals z.PartId where y.IsSkipped == 0 && (y.IsDisabled != “Y” || y.IsDisabled == null) && z.CreatedDate == x.CreatedDate && x.CreatedDate == Convert.ToDateTime(fromDate) select x).Cast<PartJoinTable>(); predicate… Read More »