Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

DB-Integration - Microsoft SQL Server #482

Open
kiran-vadla opened this issue Aug 29, 2016 · 5 comments
Open

DB-Integration - Microsoft SQL Server #482

kiran-vadla opened this issue Aug 29, 2016 · 5 comments
Assignees
Labels

Comments

@kiran-vadla
Copy link
Contributor

As part of this task , have to ensure OASP4J works well with Microsoft SQL Server 2008 , apart from the current integration with the H2 embedded database . Integration has to be identical to the way currently H2 is integrated (ie., including specific JPA configuration and Flyway migration.)

@kiran-vadla kiran-vadla self-assigned this Aug 29, 2016
@kiran-vadla
Copy link
Contributor Author

Hi All,

I was working on integrating Microsoft MSSQL Server 2008 with OASP4J. I have changed the flyway migration scripts accordingly and also have crated a 'mssql' spring profile for Database connection Url , driver details similar to application-h2mem.properties .

When I try to run 'mvn clean install', Junits for ProductImportJobTest and DrinkDaoTest are failing . Error is 'Incorrect syntax near the keyword 'user' . From the error , my understanding is that USER is a reserved keyword in MSSQL Server 2008 and hence we have to escape using square brackets .

I don't have a clue on how to proceed further since my understanding is that the SQL that is failing is being generated by Hibernate on the fly.

Attached is the complete trace of 'mvn clean install' for OASP4J project . It contains error as well.

Inputs and suggestions on overcoming this error are highly appreciated.

Thanks,
Kiran
DBIntegration-MSSQLServer2005-ErrorStackTrace.txt

@jomora
Copy link
Collaborator

jomora commented Sep 12, 2016

@kiran-vadla did you find a solution / work around / hack already? If so, could you please describe how you proceeded? This allows us to discuss if there is a problem with the current solution. Thanks

@kiran-vadla
Copy link
Contributor Author

kiran-vadla commented Sep 12, 2016

@jomora , As a solution , I have added the annotation ' @column(name = "[user]")' for user attribute of io.oasp.module.jpa.dataaccess.api.AdvancedRevisionEntity.java . Complete code is as follows :

/** @see #getUser() /
/
* Comment the following line completely (Column Annotation) in case of database other than MS SQL Server 2008 */
@column(name = "[user]")
private String user;

If you the comments section , It is mentioned that the annotation has to be removed for Database other than MS SQL Server 2008.

Thanks,
Kiran.

@kiran-vadla
Copy link
Contributor Author

Attached is the guide that contains the instructions for the installation of Microsoft SQL Server 2008 and also the instructions to configure Microsoft SQL Ser
DBIntegration - MSSQLServer - Guide.pdf
ver 2008 with OASP4J.

https://github.com/kiran-vadla/oasp4j.git is fork Url and dbIntegration-MSSQL is the branch to get the source code for 'DBIntegration with MS SQL Server 2008'

Thanks,
Kiran.

@kiran-vadla
Copy link
Contributor Author

Attaching the updated Guide.
DBIntegration - MSSQLServer - Guide.pdf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants