optimized jdbc, stream usage added, changes in isConnected method