[opencms-dev] opencms and ms-sql
zhu wei dong
donzhu2000 at hotmail.com
Wed May 21 03:35:01 CEST 2003
Hi.
It's a bug in CmsDbAccess.
Delete the following SQl statement in
com\opencms\file\mssql\query.properties will help you
1)C_RESOURCES_GET_FILESINFOLDER
2)C_RESOURCES_GET_SUBFOLDER
Good Luck!
>From: "Andy Fletcher" <AFletcher at fitchlondon.com>
>Reply-To: opencms-dev at opencms.org
>To: <opencms-dev at opencms.org>
>Subject: RE: [opencms-dev] opencms and ms-sql
>Date: Tue, 20 May 2003 15:09:40 +0100
>
>Andras,
>
>I get a similar error:
>
>com.opencms.core.CmsException: 4 Sql exception. Detailed error:
[com.opencms.file.mssql.CmsDbAccess] [Microsoft][SQLServer 2000 Driver for
JDBC]Invalid parameter binding(s)..
>root cause was java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
for JDBC]Invalid parameter binding(s).
> at
com.opencms.file.genericSql.CmsDbAccess.getFilesInFolder(CmsDbAccess.java:3383)
>
>I hadn't tried doing anything about it because we are continuing with v4
development for the time being.
>I unpacked opencms.jar, changed the properties file and repacked the jar.
It didn't stop the error when switching to the offline project. I shouldn't
need a full rebuild just to change a properties file, should I?
>
>Andy
>
>
> > -----Original Message-----
> > From: Andras Balogh [mailto:java at reea.net]
> > Sent: 20 May 2003 14:29
> > To: opencms-dev at opencms.org
> > Subject: [opencms-dev] opencms and ms-sql
> >
> >
> > Hi,
> >
> > I have had problems with the new opencms and MS-SQL 2000.
> > After installing it and logging in, when we switch to the
> > offline project
> > and the
> > Administration we got this error:
> > com.opencms.core.CmsException: 4 Sql exception. Detailed error:
> > [com.opencms.file.mssql.CmsDbAccess] parameter #2 has not been set.
> > root cause was java.sql.SQLException: parameter #2 has not been set
> > at
> > com.opencms.file.genericSql.CmsDbAccess.getFilesInFolder(CmsDb
>Access.java:33
> > 83)
> > at
> > com.opencms.file.genericSql.CmsResourceBroker.helperGetFilesIn
> > Folder(CmsReso
> > urceBroker.java:4047)
> > at
> > com.opencms.file.genericSql.CmsResourceBroker.getFilesInFolder
> > (CmsResourceBr
> > oker.java:3331)
> > at com.opencms.file.CmsObject.getFilesInFolder(CmsObject.java:1696)
> > ....
> >
> > I have tried it with 3 different jdbc drivers (not including
> > the merant
> > driver becuase we don't know from where to get it)
> > I traced down the problem to be in the file:
> > com/opencms/file/mssql/query.properties at key
> > C_RESOURCES_GET_FILESINFOLDER
> >
> > SELECT CMS_RESOURCES.RESOURCE_ID, CMS_RESOURCES.PARENT_ID, \
> > CMS_RESOURCES.RESOURCE_NAME, CMS_RESOURCES.RESOURCE_TYPE, \
> > CMS_RESOURCES.RESOURCE_FLAGS, CMS_RESOURCES.USER_ID, \
> > CMS_RESOURCES.GROUP_ID, CMS_PROJECTRESOURCES.PROJECT_ID, \
> > CMS_RESOURCES.FILE_ID, CMS_RESOURCES.ACCESS_FLAGS,
> > CMS_RESOURCES.STATE, \
> > CMS_RESOURCES.LOCKED_BY, CMS_RESOURCES.LAUNCHER_TYPE, \
> > CMS_RESOURCES.LAUNCHER_CLASSNAME, CMS_RESOURCES.DATE_CREATED, \
> > CMS_RESOURCES.DATE_LASTMODIFIED, CMS_RESOURCES.RESOURCE_SIZE, \
> > CMS_RESOURCES.RESOURCE_LASTMODIFIED_BY, \
> > CMS_RESOURCES.PROJECT_ID LOCKED_IN_PROJECT \
> > FROM CMS_RESOURCES, CMS_PROJECTRESOURCES \
> > WHERE CMS_RESOURCES.PARENT_ID=? \
> > AND CMS_RESOURCES.RESOURCE_NAME LIKE
> > RTRIM(CMS_PROJECTRESOURCES.RESOURCE_NAME)+'%' \
> > AND CMS_RESOURCES.RESOURCE_TYPE <> 0 \
> > AND CMS_PROJECTRESOURCES.PROJECT_ID = ? \
> > ORDER BY CMS_RESOURCES.RESOURCE_NAME
> >
> > As you can see the prepared statment requires 2 parameters
> > but only one is
> > set in the source code, so we removed
> > "AND CMS_PROJECTRESOURCES.PROJECT_ID = ?" part.
> > The query found in the other file:
> > com/opencms/file/genericSql/query.properties
> > seems to be correct and has only one parameter.
> >
> > After rebuilding the jar file opencms worked without errors.
> > Can an opencms developer confirm that the second part of the
> > condition is
> > not neeeded
> > or what other workaorunds, solutions exist?
> >
> > On the list only a few people complained about this error, so
> > i wonder if
> > for other developers the new opencms
> > works with ms-sql without any problem?
> >
> > Best wishes,
> >
> > Andras.
> >
> >
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list,
> > please visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
More information about the opencms-dev
mailing list