Grails groovy sql no suitable driver found for jdbc:postgresql -


i want create dynamic connection groovy.sql in grails 2.4 service throws runtime exception no suitable driver found jdbc:postgresql: service code:

import java.util.date; import java.util.formatter.datetime import java.util.prefs.backingstoreexception; import java.text.dateformat import java.text.simpledateformat import javax.sql.datasource import grails.transaction.transactional import groovy.sql.sql import groovy.time.timecategory  @transactional class identificacionservice {     def datasource_identificaciones     def getpersonaidentificaciones (string cedula) {         string padded = "0000000".substring(cedula.length()) + cedula         def conf = configuracion.findbyactivo(true)         def db = [url:conf.urlidentificaciones, user:conf.usuarioidentificaciones,              password:conf.contrasenaidentificaciones,driver:"org.postgresql.driver"]         def sql = groovy.sql.sql.newinstance(db.url,db.user,db.password,db.driver)         def rows = sql.rows("select * persona personas.cedula = ?", padded)         def row = rows.pop()         def genero = 'n/a'         if (row.sexo == 'm') genero = "masculino"         if (row.sexo == 'f') genero = "femenino"         def persona = new persona(cedula:row.cedula, nombre: row.nombres, apellido: row.apellidos,             fechanacimiento: row.fecha_nacimiento,sexo:genero,nacionalidad:row.nacionalidad,ciudad:row.lugar_nacimiento)                 sql.close()         return persona     } } 

i tried call datasource service , put in groovy.sql.sql.newinstance(datasource_identifiaciones) , work datasource can't changed on runtime. driver in lib folder suppose buildconfig.groovy adds driver after refresh dependencies. if exists way create dynamic connection string please let mi know it


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -