1

I have been trying this code in DataSource.groovy but its showing an error of "No suitable driver"

dataSource 
{
    pooled = true
    driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    String url="jdbc:microsoft:sqlserver:DSNname";
}

I have already included two jdbc SQLserver drivers sqljdbc, sqljdbc4 (*.jar files).

I also tried this code but went futile.

DataSource
{
        driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    //url="jdbc:sqlserver://localhost:1433;database=DBNAME" its working
    url="jdbc:odbc:myDSN"
    username="sa"
    password=""
}

Thanks a ton in advance.

Kamesh Prasad
  • 69
  • 1
  • 3
  • Use the JDBC connection string (`jdbc:sqlserver://...`). ODBC is not recommended: http://stackoverflow.com/questions/295603/connecting-to-sqlserver-using-jdbc-odbc-bridge – Andrew Mar 06 '13 at 19:08
  • We dont want to make it hardwired so if ill change the server i need not to change the server name and just need to use the DSN. that is why I'm trying ODBC, – Kamesh Prasad Mar 06 '13 at 20:52
  • Thank You. We are done with the connection using ODBC but its having problem. used dialect = "org.hibernate.dialect.SQLServerDialect" – Kamesh Prasad Mar 06 '13 at 20:53
  • Code My answer and Solution- [Externalizing Grails Datasource](http://stackoverflow.com/questions/970133/externalizing-grails-datasource-configuration) – Kamesh Prasad Mar 07 '13 at 19:06

0 Answers0