Methods : prepareStatement

advertisement
Issue:
Aim: Deployment of OpenText application in WebSphere 8.5.5.2 along with branded data direct jar
VDoracle.jar.
Issue: Unable to query the database to fetch the data. Throwing error even for “select” statements. Test
program and war file mentioned below for your reference. Getting the below error:
java.sql.SQLException:
[OpenText][Oracle JDBC Driver]This driver is locked for use with embedded applications.
But, test connection is successful from WebSphere to database configured. In application code, doing lookup
of data source (JNDI: OracleDS) and tried to fetch the record from database.
Removed the ojdbc6.jar and added VDoracle.jar in JVM classpath of WebSphere.
Application environment details are
Windows Server 2008 R2 standard 64 bit OS
WebSphere Application Server 8.5.5.2
Oracle11.2
VDoracle.jar.
Currently using same VDoracle.jar under the environment AIX + JBOSS + Oracle11.2 + VDoracle.jar
Any configuration/code changes required under VDoracle.jar to support W2k8 R2 server + WAS 8.5.5.2 ?
WebSphere Log information:
00000070 DSConfigurati
00000070 DSConfigurati
00000070 DSConfigurati
00000070 DSConfigurati
(F000153.U000068)
00000070 DSConfigurati
I
I
I
I
DSRA8203I:
DSRA8204I:
DSRA8205I:
DSRA8206I:
Database product name : Oracle
Database product version : 11.2.0.1.0
JDBC driver name : Oracle
JDBC driver version : 5.1.3.000142
I
DSRA8025I: Successfully connected to DataSource.
Websphere configuration (VDoracle.jar):
Data sources
Data sources > OracleDS_VDoracle
Data sources > OracleDS_VDoracle > Custom properties
JDBC providers > VDoracleJDBCProvider
JDBC providers > VDoracleJDBCProvider > Data sources
Data sources > OracleDS_VDoracle > JAAS - J2C authentication data
OpenText Application Error:
Log attached below:
Test Application Output :
Test Java Code :
package omg.test;
import java.sql.Connection;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Method;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
public class JDBCError extends HttpServlet
{
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException
{
PrintWriter out = resp.getWriter();
try
{
out.println("
=================================================== ");
connect(req,resp);
out.println("
=================================================== ");
} catch (Exception e)
{
out.println("Got an exception in test ----- at doGet" +
e.getMessage());
}
}
public static void connect(HttpServletRequest req,
HttpServletResponse resp) throws Exception
{
DataSource mDataSrc;
InitialContext context = null;
Connection connect=null;
PrintWriter out = resp.getWriter();
out.println("*********** Connection Test with Websphere using
VDOracle.jar ***********");
out.println("-------------------------------------------------------------------------");
try
{
context = new InitialContext();
mDataSrc = (DataSource)context.lookup("OracleDS");
connect = mDataSrc.getConnection();
out.println("context Namespace
------------------"+context.getNameInNamespace());
out.println("context class
------------------"+context.getClass().getName());
out.println("Datasource
------------------"+mDataSrc.getClass().getName());
out.println("Connection Class
------------------"+connect.getClass().getName());
out.println("Super of Connection
------------------"+connect.getClass().getSuperclass().getName());
out.println("Database Product
------------------"+connect.getMetaData().getDatabaseProductName());
out.println("DB Major-Minor Version------------------"+connect.getMetaData().getDatabaseMajorVersion()+""+connect.getMetaData().getDatabaseMinorVersion());
out.println("Select statement ......... Start ");
Statement stmt = connect.createStatement();
out.println("Got statement instance.... ");
ResultSet rs = stmt.executeQuery("select * from
table_name");
while (rs.next()) {
Date date = rs.getDate("de");
out.println("Date fetched from DB =" + date );
}
out.println("Select statement .... Complete ");
}
catch (SQLException se)
{
out.println("Inside SQLException ");
out.println(se.toString());
out.println(se.getMessage());
}
try
{
Method[] method = null;
method = connect.getClass().getMethods();
out.println("Methods of Connection class " +
connect.getClass().getName()+" are mentioned below ... ");
for(Method method1 : method)
{
out.println("Methods : " + method1.getName());
}
}
catch (Exception e)
{
out.println("Inside Exception ");
out.println(e.toString());
out.println(e.getMessage());
}
finally{
connect.close();
}
}
}
Error got while query with select statement.
http://xx.yy.zz.00:9080/progressselect
Printing the data of test program on the webpage.
===================================================
*********** Connection Test with Websphere using VDOracle.jar ***********
-------------------------------------------------------------------------context Namespace
-------------------WINCOSA3MGR20ONode01Cell/nodes/WIN-COSA3MGR20ONode01/servers/server1
context class
-------------------javax.naming.InitialContext
Datasource
------------------com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
Connection Class
------------------com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
Super of Connection
------------------com.ibm.ws.rsadapter.jdbc.WSJdbcObject
Database Product
-------------------Oracle
DB Major-Minor Version-------------------11-2
Select statement ......... Start
Inside SQLException
java.sql.SQLException: [OpenText][Oracle JDBC Driver]This driver is locked
for use with embedded applications.
[OpenText][Oracle JDBC Driver]This driver is locked for use with embedded
applications.
Methods of Connection class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection are
mentioned below ...
Methods : equals
Methods : hashCode
Methods : toString
Methods : activate
Methods : invoke
Methods : isWrapperFor
Methods : unwrap
Methods : close
Methods : closeChildWrappers
Methods : getJNDIName
Methods : getState
Methods : getStateString
Methods : init
Methods : introspectSelf
Methods : isClosed
Methods : initialize
Methods : clearWarnings
Methods : commit
Methods : createArrayOf
Methods : createBlob
Methods : createClob
Methods : createNClob
Methods : createSQLXML
Methods : createStatement
Methods : createStatement
Methods : createStruct
Methods : dissociate
Methods : fireConnectionErrorEvent
Methods : fireConnectionErrorEvent
Methods : getAutoCommit
Methods : getManagedConnection
Methods : getCatalog
Methods : getClientInfo
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
Methods
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
getClientInfo
getHelper
getInternalDataStoreHelper
getMetaData
getTransactionIsolation
getTypeMap
getWarnings
isReadOnly
isReserved
isShareable
isValid
nativeSQL
prepareCall
prepareCall
prepareStatement
prepareStatement
reassociate
reserve
rollback
setAutoCommit
setCatalog
setReadOnly
setTransactionIsolation
setTypeMap
supportsImplicitReactivation
getCRI
setHoldability
getHoldability
setSavepoint
setSavepoint
rollback
releaseSavepoint
createStatement
prepareStatement
prepareCall
prepareStatement
prepareStatement
prepareStatement
setClientInfo
setClientInfo
setClientInformation
getClientInformation
getSystemMonitor
clearStatementCache
setThreadID
getNativeConnection
setJ2EEName
getJ2EEName
markStmtsAsNotPoolable
setPoolableFlag
abort
getNetworkTimeout
getSchema
setNetworkTimeout
setSchema
getClass
notify
notifyAll
wait
wait
wait
War Package created to test:
progressselect.war
Download