Has anyone been successful in installing SnipSnap v0.5a-Farnham into MS Sql Server by specifing a Generic JDBC Source during installation? I've tried to do so with the
net.sourceforge.jtds.jdbc.Driver and
com.microsoft.jdbc.sqlserver.SQLServerDriver and had no success yet.
I had to copy both driver's jars to
src/apps/default/WEB-INF/lib before it successfully located them(, and then I copied them to every other lib directory for good measure).
The following was attempted during a new install using the admin setup web pages. (I was not editing a working applications .conf)
When providing the url, driver, and username and password, in both cases below the setup UI offers:
- The database password may be wrong.
- The database user may be wrong.
- Error: Please verify that your JDBC URL is completely specified and the database user and password are correct.
...despite different errors in the log for the different drivers:
com.microsoft.jdbc.sqlserver.SQLServerDriver
url: jdbc:com.microsoft.jdbc.sqlserver.SQLServerDriver://localhost:1433/snipsnap
driver: com.microsoft.jdbc.sqlserver.SQLServerDriver
ConnectionManager: Registering JDBC driver: com.microsoft.jdbc.sqlserver.SQLServerDriver
JDBCApplicationManager: dropping application SQL table
JDBCApplicationManager: creating application SQL table
java.lang.RuntimeException: JDBCTemplate: unable to execute query
at org.snipsnap.jdbc.JDBCTemplate.update(JDBCTemplate.java:71)
at org.snipsnap.app.JDBCApplicationStorage.createStorage(JDBCApplicationStorage.java:63)
…
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:94)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:300)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:816)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
at org.snipsnap.jdbc.JDBCTemplate.update(JDBCTemplate.java:63)
… 23 more
Acknowledging SQLServerDriver's failure in the original attempt this snip documented, I'm content to believe it just won't work, and the error kinda supports that. Moving on to the proven driver before I waste too much time…
net.sourceforge.jtds.jdbc.Driver
url: jdbc:jtds:sqlserver://localhost:1433/snipsnap
driver: net.sourceforge.jtds.jdbc.Driver
ConnectionManager: Registering JDBC driver: net.sourceforge.jtds.jdbc.Driver
JDBCApplicationManager: dropping application SQL table
JDBCApplicationManager: creating application SQL table
java.lang.RuntimeException: JDBCTemplate: unable to execute query
at org.snipsnap.jdbc.JDBCTemplate.update(JDBCTemplate.java:71)
at org.snipsnap.app.JDBCApplicationStorage.createStorage(JDBCApplicationStorage.java:63)
…
Caused by: java.sql.SQLException: Logon failed. Msg 18456, Severity 14, State 1, Login failed for user 'snipsnap_user'., Server , Procedure , Line 0
at net.sourceforge.jtds.jdbc.Tds.<init>(Tds.java:235)
at net.sourceforge.jtds.jdbc.TdsConnection.allocateTds(TdsConnection.java:704)
at net.sourceforge.jtds.jdbc.TdsConnection.<init>(TdsConnection.java:165)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:85)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:94)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:300)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:816)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
at org.snipsnap.jdbc.JDBCTemplate.update(JDBCTemplate.java:63)
… 23 more
I'm certain the "snipsnap_user" is valid for access to the snipsnap database I created, and I provided the correct password; I'm not sure if I'm doing something else wrong here. Any ideas?