Announcement Announcement Module
Collapse
No announcement yet.
Grails with SQL Server data source Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grails with SQL Server data source

    This is not a question but a comment to anyone looking for help to set up a data source from a Grails application to SQL Server. I have been trying all day and just cracked the problem.

    I was trying to connect to SQL Server 2008 via the new microsoft jdbc driver 3.0. I also have JRE 6 (JDK 1.6.0_18) running on my machine.

    I had already setup the DataSource.groovy file with:

    dataSource {
    pooled = true
    driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    ...

    environments {
    development {
    dataSource {
    dbCreate = "create-drop" // one of 'create', 'create-drop','update'
    url = "jdbc:sqlserver://<DBServerName>"
    ...

    I also had right-clicked grails application - properties - Java build path - Add external JARs and added sqljdbc4.jar into it. I don't know why I put it here but it's completely unnecessary. I think I added it here because that's the only place I could find class paths. But later I right clicked lib folder under the grails application and imported the same jar file and it all worked fine.

    So hope this helps someone.
Working...
X