Edited the JDBC function to print result