Database assignment using JDBC