Problem while executing the stored procedure [message #387429] |
Wed, 29 April 2009 02:13  |
Eclipse User |
|
|
|
Hi,
I have a simple procedure in SQLServer database.While I am executing
the procedure using EclipseLink JPA I am getting some errors.
Project project = new Project();
DatabaseLogin login = new DatabaseLogin();
login.setUserName(DATABASE_USERNAME);
login.setPassword(DATABASE_PASSWORD);
login.setConnectionString(DATABASE_URL);
login.setDriverClassName(DATABASE_DRIVER);
login.setDatabaseName("testdemo22");
project.setDatasourceLogin(login);
Session s = project.createDatabaseSession();
s.setLogLevel(SessionLog.FINE);
((DatabaseSession)s).login();
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("insert_user");//procedure name
DataModifyQuery query = new DataModifyQuery();
query.setCall(call);
s.executeQuery(query);
When I run this code I am gettting the folllowing errors.
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException:
Incorrect syntax near the keyword 'PROCEDURE'.
Error Code: 156
Call: EXECUTE PROCEDURE insert_user()
Query: DataModifyQuery()
Exception in thread "main" Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.0 (Build
1.0 - 20080707)): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException:
Incorrect syntax near the keyword 'PROCEDURE'.
Error Code: 156
Call: EXECUTE PROCEDURE insert_user()
Query: DataModifyQuery()
at
org.eclipse.persistence.exceptions.DatabaseException.sqlExce ption(DatabaseException.java:313)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAcce ssor.executeDirectNoSelect(DatabaseAccessor.java:757)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAcce ssor.executeNoSelect(DatabaseAccessor.java:823)
Any Ideas please?
Regards
kondal
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04127 seconds