on 06-12-2007 2:36 PM
Hi,
How do you write Native SQL commands for a datasource whose SQL Engine type is Open SQL. For Eg: i have a datasource MyDS with SQL Engine type as Open SQL. For a connection "conn" to this datasource i cannot use methods like
conn.createStatement(int,int) as it is not supported by open sql.
Thanks in advance
i have gone thru the links tht u have mentioned. it requires some additional JARs for the same. Trying to find out wat JARs are reqd and where will i get it from ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nirav,
Sure This will help u...
Check the following links...
http://help.sap.com/javadocs/NW04S/current/ol/com/sap/sql/NativeSQLAccess.html
http://forums.mysql.com/read.php?41,144839,153276
http://www.devx.com/tips/Tip/5641
URs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Check this URL and you will Some ideas
Sample Native SQL Code
http://help.sap.com/saphelp_nw04/helpdata/en/51/ef9f94e4ba894d8e93b2eed7c9f82d/frameset.htm
For detailed Explanation
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/frameset.htm
Open SQL/JDBC
http://help.sap.com/saphelp_nw04/helpdata/en/57/1177611c11cd418564cdbc1488ce33/frameset.htm
SQL Engine
http://help.sap.com/saphelp_nw04/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/frameset.htm
Regards
Chandran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the static method NativeSQLAccess.getVendorID(Connection conn), you can determine the underlying database vendor. You use this method to ensure that a non-portable SQL statement is issued on the corresponding database platform only.
The NativeSQLAccess class offers three options for issuing a non-portable SQL statement:
· NativeSQLAccess.createNativeStatement() generates an object of the class java.sql.Statement.
· NativeSQLAccess.prepareNativeStatement() generates an object of the class java.sql.PreparedStatement.
· NativeSQLAccess.prepareNativeCall() generates an object of the class java.sql.CallableStatement (a Stored Procedure is called).
import java.sql.PreparedStatement;
import com.sap.sql.NativeSQLAccess;
String mssOnlyStmt = " ";
// ensure correct process environment
if (NativeSQLAccess.getVendorID(conn) !=
NativeSQLAccess.VENDOR_MS_SQL_SERVER) {
// error handling
} else {
// variant 1
PreparedStatement ps =
NativeSQLAccess.prepareNativeStatement(
conn, mssOnlyStmt);
. . .
// variant 2
Statement stmt =
NativeSQLAccess.createNativeStatement(conn);
int result = stmt.execute(mssOnlyStmt);
. . .
// variant 3
CallableStatement cs =
NativeSQLAccess.prepareNativeCall(
conn, mssOnlyStmt);
. . .
}
And also see this link..
http://help.sap.com/saphelp_nw04/helpdata/en/bb/d604ad96d444bfa6cb15652d44b2a8/frameset.htm
Urs GS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this link this maybe helpful to you
http://help.sap.com/saphelp_nw04/helpdata/en/51/ef9f94e4ba894d8e93b2eed7c9f82d/frameset.htm
Regards,
SURYA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.