[Opensource] SQL Server 2000
Michael Rimov
rimovm at centercomp.com
Sat Jan 4 16:58:18 PST 2003
At 05:17 PM 1/3/2003 -0200, you wrote:
>I'm having troubles to use SQL Server as a database context. First I
>created the context as
>
> <context name="sqlserver">
> <description>MS SQL Server 2000</description>
> <jdbc driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" url
>="jdbc:microsoft:sqlserver://SERVER:1433;User=USER;Password=PASSWORD"
>connectFormat="1" login="USER" password="PASSWORD" dateSelectFormat
>="dd-MM-yyyy" dateUpdateFormat="dd-MM-yyyy" dateTimeSelectFormat
>="yyyy-MM-dd" dateTimeUpdateFormat="yyyy-MM-dd" cache="y">
> <dbWildcard>%</dbWildcard>
> <dbWildcard>*</dbWildcard>
> </jdbc>
> <type-mapping>
> <java-type>LONGVARCHAR</java-type>
> <expresso-type>text</expresso-type>
> <db-type>text</db-type>
> </type-mapping>
> <images>%context%/%expresso-dir%/images</images>
> <startJobHandler>y</startJobHandler>
> <showStackTrace>y</showStackTrace>
> <mailDebug>n</mailDebug>
> </context>
>
>
>but I had problems to start expresso. Then I found about the hasSetupTables
>option, and I could start Expresso by adding
>
><hasSetupTables>false</hasSetupTables>
>
>to the context configuration.
>
>
>
>Now, when I try to create the tables in this context (Setup -> Create
>Database Structure), I get the error
>
>javax.servlet.ServletException: Unable to execute statement: CREATE TABLE
>DOWNLOADFILES(FileNumber int identity not null, FilePathName text not null,
>DisplayName nvarchar(128), FileURL text, Descrip nvarchar(80) not null,
>FileType nvarchar(30), Project nchar(10), GroupName nchar(10) not null,
>LastUpdated binary, DLNotes text, MimeNumber int identity not null,
>IsActive nchar(1) not null, IsRestricted
>bit)(com.jcorporate.expresso.core.dbobj.Schema.createTable(), db/context
>'sqlserver'):[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Multiple
>identity columns specified for table 'DOWNLOADFILES'. Only one identity
>column per table is allowed.
You're going to have to add a mapping to override the MSSQL JDBC driver
mapping integers to 'identity'. It will look something like this:
<type-mapping>
<expresso-type>int</expresso-type>
<db-type>integer</db-type>
</type-mapping>
I don't have MS-SQL installed on my system yet, so I can't confirm what the
exact mapping would be, but the principle is the same.
HTH!
-Mike
More information about the Opensource
mailing list