Note that the default query 'SHOW TABLES' is not supported by PostgreSQL. Use this instead: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
J'ai ajouté le code ci-dessous pour ne pas avoir à passer par un formulaire :
/
Obtenir un objet connection à partir des paramètres */ Connection getConnectionFromParameters(url, userName, password, driver){ if(!userName) throw new Exception("You must fill the field 'user'"); if(!url) throw new Exception("You must fill the field 'url'"); if(!driver) throw new Exception("You must fill the field 'driver'"); Class.forName (driver).newInstance (); def conn = DriverManager.getConnection (url, userName, password); return conn; }
Note that the default query 'SHOW TABLES' is not supported by PostgreSQL. Use this instead:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
J'ai ajouté le code ci-dessous pour ne pas avoir à passer par un formulaire :
/
*/
Connection getConnectionFromParameters(url, userName, password, driver){
if(!userName)
throw new Exception("You must fill the field 'user'");
if(!url)
throw new Exception("You must fill the field 'url'");
if(!driver)
throw new Exception("You must fill the field 'driver'");
Class.forName (driver).newInstance ();
def conn = DriverManager.getConnection (url, userName, password);
return conn;
}