on 05-02-2008 5:14 AM
Hi All,
I am trying to write Native SQL queries using Open sql data source . I found the following code in sap help , but i am not able to find appropriate JAR file for com.sap.sql.NativeSQLAccess , can some one tell me what is the JAR file
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);
. . .
}
Go to Web Dynpro Explorer, from your context menu select properties
Go to Java Build path
click on Add variable
Select ECLIPSE_HOME click on extend
under plugins find com.sap.opensql_2xx
select opensqlsta.jar under lib and click ok
Now, you can use the code
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Raj,
Go through this link;
Connecting to Oracle DB using Java WD
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=45572
In your case; you can see and include Jar files using the Package Explorer Window, where select your project, right click and select the Set Additional Libraries and you will find the Jar files there( opensql).
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
I have no idea what this class does but you can find the same in \usr\sap\<Your instance>\JC00\j2ee\configtool\lib\opensqlsta.jar.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.