on 12-30-2005 9:50 AM
Hi,
I am migrating a J2ee project to SAP netweaver server. As a part of the project, some time i need to store empty string, null values or spaces to the databse tables. But when ever I am trying to insert a record in to the DB with some field values as empty strings (""), I am getting a SQL Exception as given below,
<b>"com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 3"</b>
When i tried to insert a record with empty string as some field values directly in to the table using SQL(insert into.. )statement, I am able to insert the record.
I need to pass the empty string based on the application requirement
Your help and suggestions solicited in this regard.
Thankyou,
Sudheesh K S....
Hi Sudheesh,
What kind of persistence object you get this problem with? Is it a CMP entity bean? Do you use an external database, not the one that comes with the NetWeaver?
The error looks like the datasource uses OpenSQL instead of native or vendor SQL (which may prevent from doing what you want to do).
Check the settings of your datasource in the JDBC connector of the Visual Administrator tool, tabstrip "Additional": it should be native sql (or vendor sql) if you use an external database.
Bye,
Rudi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rudolf,
Thankyou very much for your reply. Infact i am using CMP Entity beans. I am also using the default DB connection which comes with netweaver (SAP DB).
I searched the JDBC Connector tab of Visual Administrator tool I found Data Source "SAPJ2EDB"; but when i checked for SQL Engine in the "Additional" tab, "Open SQL" is selected. But the all of the three radio button are disabled
Rudolf, Is it because of this settings, I am getting the error? if yes, could you please share your knowledge to change it?
With best regards,
Sudheesh...
Hi,
You are right the SQL Engine option on the 'Additional Tab' are disabled. This is because this is the default database used by WebAS and changes can (mostly will) affect the implementation totally.
Also we refrain from using the default Database for Application purpose.
If we create a seperate batabase then you will have it specifically for your application and also you will have the options (in the 'Additional Tab') enabled.
Regards,
S.Divakar
Dear sir,
Happy New year...
Thankyou very much for your response. I have registered a seperate data source and deployed it in the server using Visual Administration. I made the changes accordingly to the application. But I am getting the error as given below,
"Clusterwide exception: server ID 4102250:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot register aliases for DataSource "SAPJ2EDB".
Could you please tell me what could be the possible reason?
With best regards,
Sudheesh K S
Hi,
1. Restart the Server and check in the Visual Administrator Server -> Services -> Deploy, take the group by Applications option.
2. If you see the application (for the datasource you just created, [sap.com/<DataSource Application name>]) in the list of application, delete it
3. Create a new Datasource and the deploy, this should be successful.
Regards,
S.Divakar
Hi Sujesh,
Thank you very much for your response. I am migrating an existing j2ee application from JBOSS to SAP Netweaver. The back end database is MYSQL.
We are using CMP Beans with struts frame work. Since i am working in this server for the first time, I have a lot of doubts regarding the deployement and database connectivity.
Now the problems facing are solving slowly with the enormous help from the technocrats from the forums...
Best Regards,
Sudheesh...
Hi sujesh,
Thank you for your comment. So far i used the reference manuals from SAP only. And ofcouurce i got enormous help from SAP Forum. I will mail you the links of the tutorial to your per. Email.
Bu in the mean time if you need any service from me. don't hesitate to mail me to k.ssudheesh@gmail.com
With best regards,
Sudheesh...
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.