9i JDeveloper, nullPointerException, thin driver to 9i on Linux-Help
Environment Win2K with 9i client software.
I have 9i JDeveloper configured on a Win2K machine such that it can connect to a Solaris 8 environment running 9i using a thin JDBC driver via the connections in the JDeveloper navigator. It works fine.
I can launch sqlplus from the Win2K machine and connect to 9i on SuSE 7.3, it works fine.
I can connect to the 9i DB on SuSE using Access 2000 and ODBC no problem.
On the SuSE side I also have 9i JDeveloper and it can connect via the connections wizard to the local 9i database and browse the schema.
I run through the connections wizard on my Win2K machine to setup my connection to 9i on SuSE 7.3 and test. it works fine.
The problem is when I try to open the database connection to 9i on SuSE from the Win2K machine from within JDeveloper. Then I get a NullPointerException - see below.
oracle.jdeveloper.cm.CMException: java.lang.NullPointerException
void oracle.jdeveloper.cm.dt.browser.jdbc.JdbcBrowser.openConnectionBrowser(oracle.jdeveloper.cm.dt.ConnectionBrowsable)
void oracle.jdeveloper.cm.dt.ConnectionNode.open()
java.util.Iterator oracle.jdeveloper.cm.dt.ConnectionNode.getChildren()
java.util.Iterator oracle.ideimpl.explorer.ExplorerNode.getChildNodes()
void oracle.ideimpl.explorer.BaseTreeExplorer.addChildren(oracle.ide.explorer.TNode)
void oracle.ideimpl.explorer.BaseTreeExplorer$4.run()
void java.awt.event.InvocationEvent.dispatch()
void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
void java.awt.Dialog.show()
void java.awt.Component.show(boolean)
void java.awt.Component.setVisible(boolean)
But if I look at the listener.log on SuSE is looks like the connection succeeded.
service_update * mydev * 0
25-AUG-2002 09:43:14 * service_update * mydev * 0
25-AUG-2002 09:53:16 * service_update * mydev * 0
25-AUG-2002 10:01:05 * (CONNECT_DATA=(SID=mydev)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=1059)) * establish * mydev * 0
25-AUG-2002 10:01:10 * (CONNECT_DATA=(SID=mydev)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=1060)) * establish * mydev * 0
25-AUG-2002 10:01:12 * service_update * mydev * 0
25-AUG-2002 10:01:15 * service_update * mydev * 0
I see no difference in the log between this failed connection and the successful connection I get when I connect using JDeveloper on SuSE connecting to 9i on SuSE other than a different IP address.
I am at a loss. Can anybody give me a clue as to why I am getting the null pointer exception when I try to open a database connection from Win2K JDeveloper to 9i on SuSE. I have also tried a URL string and that fails as well.
Thanks
Hunch
Bob,
The error you are getting is not related to connecting to the database. Instead, it is a bug inside of JDeveloper that is related to expanding the database connection in the Navigator.
Off the top of my head, I'm not sure what the problem is, but I will try to look back through our bug logs to see what I can dig up. In the meantime, can your confirm for me that the version of JDeveloper you are using is the 9.0.2 production release?
- John McGinnis
Oracle JDeveloper Team
Similar Messages
-
How to use oracle thin driver?...pls help
Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
My previous code read as:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
AndrewClass.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SSID", "user", "password"); -
How to use oracle thin driver with jsp?...pls help
Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
My previous code read as:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
Andrewmy code is:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(sConnStr, sUser, sPassword);
notice the driver --"oracle.jdbc.driver.OracleDriver"!
and copy the class12.zip to lib path
if still not work
change the class12.zip to class12.jar
good luck -
I am using CLOBS with the Oracle thin driver and am experiencing horrible performance. We need datavalues more than a VARCHAR2 and have used CLOB but the method Oracle uses to get the data in and out is super slow.
MS SQL Server JDBC with text is awesome and fast. But Oracle is slow and very cumbersome.
HelpWe are using 9.0.2.
So what you are saying is although the column is CLOB
in Oracle 10 g we can use a normal result set
rset.getString( 1 ) no special oracle stuff just the
e Oracle thin driver for 10g?
Also this will retrieve a String greater than 4000
bytes?Exactly. Not only you can retieve a clob as string, you can also insert clob
as a string too. Here is the code I referred in last post in case you do not
have access to oracle ten network:
* @author Savitha
* @version 1.0
* Development Environment : Oracle JDeveloper 10g
* Name of the Application : ClobManipulationIn10g.java
* Creation/Modification History :
* Savitha 17-Mar-2004 Created.
package oracle.otnsamples.jdbc;
// Java SQL classes
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
// Oracle JDBC driver class
import oracle.jdbc.OracleDriver;
// Java IO classes
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
//Java Util classes
import java.util.Properties;
* This class demonstrates the Oracle JDBC 10g enhanced features for inserting
* and retrieving CLOB data from the database. Using the new features, large
* data of more than 32765 bytes can be inserted into the database using the
* existing PreparedStatement.setString() and PreparedStatement.getString()
* methods.
public class ClobManipulationIn10g {
/* Database Connection object */
private Connection conn = null;
/* Variables to hold database details */
private String url = null;
private String user = null;
private String password = null;
// Create a property object to hold the username, password and
// the new property SetBigStringTryClob.
private Properties props = new Properties();
/* String to hold file name */
private String fileName = null;
* Default Constructor to instantiate and get a handle to class methods
* and variables.
public ClobManipulationIn10g(String fileName) {
this.fileName = fileName;
* Main runnable class.
public static void main(String[] args) throws SQLException {
// Instantiate the main class.
ClobManipulationIn10g clobManipulationIn10g =
new ClobManipulationIn10g(args[0]);
// Load the Oracle JDBC driver class.
DriverManager.registerDriver(new OracleDriver());
// Load the database details into the variables.
String dbUrl = "jdbc:oracle:thin:@<database host machine>:<port>:<SID>";
clobManipulationIn10g.url = dbUrl;
// Replace the username where the table 'clob_tab' was created.
clobManipulationIn10g.user = "scott";
// Replace the password of the username.
clobManipulationIn10g.password = "tiger";
// Populate the property object to hold the username, password and
// the new property 'SetBigStringTryClob' which is set to true. Setting
// this property allows inserting of large data using the existing
// setString() method, to a CLOB column in the database.
clobManipulationIn10g.props.put("user", clobManipulationIn10g.user );
clobManipulationIn10g.props.put("password", clobManipulationIn10g.password);
clobManipulationIn10g.props.put("SetBigStringTryClob", "true");
// Check if the table 'CLOB_TAB' is present in the database.
clobManipulationIn10g.checkTables();
// Call the methods to insert and select CLOB from the database.
clobManipulationIn10g.insertClob();
clobManipulationIn10g.selectClob();
* This method will insert the data into a CLOB column in the database.
* Oracle JDBC 10g has enhanced the existing PreparedStatement.setString()
* method for setting the data more than 32765 bytes. So, using setString(),
* it is now easy to insert CLOB data into the database directly.
private void insertClob() throws SQLException {
// Create a PreparedStatement object.
PreparedStatement pstmt = null;
try {
// Create the database connection, if it is closed.
if ((conn==null)||conn.isClosed()){
// Connect to the database.
conn = DriverManager.getConnection( this.url, this.props );
// Create SQL query to insert data into the CLOB column in the database.
String sql = "INSERT INTO clob_tab VALUES(?)";
// Read a big file(larger than 32765 bytes)
String str = this.readFile();
// Create the OraclePreparedStatement object
pstmt = conn.prepareStatement(sql);
// Use the same setString() method which is enhanced to insert
// the CLOB data. The string data is automatically transformed into a
// clob and inserted into the database column. Make sure that the
// Connection property - 'SetBigStringTryClob' is set to true for
// the insert to happen.
pstmt.setString(1,str);
// Execute the PreparedStatement
pstmt.executeUpdate();
} catch (SQLException sqlex) {
// Catch Exceptions and display messages accordingly.
System.out.println("SQLException while connecting and inserting into " +
"the database table: " + sqlex.toString());
} catch (Exception ex) {
System.out.println("Exception while connecting and inserting into the" +
" database table: " + ex.toString());
} finally {
// Close the Statement and the connection objects.
if (pstmt!=null) pstmt.close();
if (conn!=null) conn.close();
* This method reads the CLOB data from the database by using getString()
* method.
private void selectClob() throws SQLException {
// Create a PreparedStatement object
PreparedStatement pstmt = null;
// Create a ResultSet to hold the records retrieved.
ResultSet rset = null;
try {
// Create the database connection, if it is closed.
if ((conn==null)||conn.isClosed()){
// Connect to the database.
conn = DriverManager.getConnection( this.url, this.props );
// Create SQL query statement to retrieve records having CLOB data from
// the database.
String sqlCall = "SELECT clob_col FROM clob_tab";
pstmt= conn.prepareStatement(sqlCall);
// Execute the PrepareStatement
rset = pstmt.executeQuery();
String clobVal = null;
// Get the CLOB value from the resultset
while (rset.next()) {
clobVal = rset.getString(1);
System.out.println("CLOB length: "+clobVal.length());
} catch (SQLException sqlex) {
// Catch Exceptions and display messages accordingly.
System.out.println("SQLException while connecting and querying the " +
"database table: " + sqlex.toString());
} catch (Exception ex) {
System.out.println("Exception while connecting and querying the " +
"database table: " + ex.toString());
} finally {
// Close the resultset, statement and the connection objects.
if (rset !=null) rset.close();
if (pstmt!=null) pstmt.close();
if (conn!=null) conn.close();
* Method to check if the table ('CLOB_TAB') exists in the database; if not
* then it is created.
* Table Name: CLOB_TAB
* Column Name Type
* col_col CLOB
private void checkTables() {
Statement stmt = null;
ResultSet rset = null;
try {
// Create the database connection, if it is closed.
if ((conn==null)||conn.isClosed()){
// Connect to the database.
conn = DriverManager.getConnection( this.url, this.props );
// Create Statement object
stmt = conn.createStatement();
// Check if the table is present
rset = stmt.executeQuery(" SELECT table_name FROM user_tables "+
" WHERE table_name = 'CLOB_TAB' ");
// If the table is not present, then create the table.
if (!rset.next()) {
// Table does not exist, create it
stmt.executeUpdate(" CREATE TABLE clob_tab(clob_col CLOB)");
} catch (SQLException sqlEx) {
System.out.println("Could not create table clob_tab : "
+sqlEx.toString());
} finally {
try {
if( rset != null ) rset.close();
if( stmt != null ) stmt.close();
if (conn!=null) conn.close();
} catch(SQLException ex) {
System.out.println("Could not close objects in checkTables method : "
+ex.toString());
* This method reads the specified text file and, returns the content
* as a string.
private String readFile()
throws FileNotFoundException, IOException{
// Read the file whose content has to be passed as String
BufferedReader br = new BufferedReader(new FileReader(fileName));
String nextLine = "";
StringBuffer sb = new StringBuffer();
while ((nextLine = br.readLine()) != null) {
sb.append(nextLine);
// Convert the content into to a string
String clobData = sb.toString();
// Return the data.
return clobData;
} -
Petstore throws populateServlet error with Oracle thin driver
When i point connection pool to Oracle database, i get the following error. The
data is populated in the database, looks like when petstore is enumerating db
tables and make sure all tables exist, this error is happening. Some how, database
metadata coming as NULL. Has anybody tried petstore with Oracle JDBC driver?
thanks,
PopulateServlet Error:
java.lang.NullPointerException java.lang.NullPointerException at com.sun.j2ee.blueprints.tools.populate.web.PopulateServlet.checkTables(PopulateServlet.java:276)
at com.sun.j2ee.blueprints.tools.populate.web.PopulateServlet.doGet(PopulateServlet.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)I believe that you do not have weblogicaux.jar in your classpath.
-Selvan
Laurie Cohen wrote:
Im using Solaris 2.7 with WLS 5.1.0 and Commerce Server 2.0.1 with
current service packs on both. JDK 1.2.1_04 and the Oracle thin driver
(classes111.zip which I am told is the only one supported in this
configuration). Has anyone seen this problem? Is it that the driver is
using 1.1 and I only have 1.2 installed?
devapp01% java -classpath
/usr/local/weblogic/classes:/usr/local/weblogic/license utils.t3dbping
t3://localhost:7601 username password "" oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@10.200.201.110:1521:q01c
Connecting to WebLogic with the WebLogic JDBC Driver
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/java/util/collections/ArrayList
at weblogic.kernel.Kernel.declareProperties(Kernel.java:253)
at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:107)
at weblogic.common.T3Client.<init>(T3Client.java:218)
at weblogic.common.T3Client.<init>(T3Client.java:269)
at weblogic.common.T3Client.<init>(T3Client.java:323)
at weblogic.jdbcbase.t3.Driver.connect(Driver.java:121)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:106)
at utils.t3dbping.main(t3dbping.java:115)
Thanks,
Laurie -
Problem in WSAD 5.0.0 with Oracle thin Driver
Hi All,
Can anyone help me to solve the following problem while using a batch update
java.lang.NullPointerException
at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)
at oracle.jdbc.driver.OraclePreparedStatement.clearParameters(OraclePreparedStatement.java:3401)
at oracle.jdbc.driver.OracleCallableStatement.clearParameters(OracleCallableStatement.java:818)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.resetStatement(WSJdbcConnection.java:1767)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareCall(WSJdbcConnection.java:1381)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareCall(WSJdbcConnection.java:1346)
at com.americanexpress.statdc.manual.dao.ManualStatLoadDAO.loadStatItems(ManualStatLoadDAO.java:668)
at com.americanexpress.statdc.manual.dao.ManualStatLoadDAO.submitStatItems(ManualStatLoadDAO.java:609)
at com.americanexpress.statdc.manual.ejb.ManualStatLoadEJBBean.submitStatItems(ManualStatLoadEJBBean.java:252)
at com.americanexpress.statdc.manual.ejb.EJSRemoteStatelessManualStatLoadEJB_38e2da07.submitStatItems(EJSRemoteStatelessManualStatLoadEJB_38e2da07.java:472)
at com.americanexpress.statdc.manual.ejb._ManualStatLoadEJB_Stub.submitStatItems(_ManualStatLoadEJB_Stub.java:451)
at com.americanexpress.statdc.manual.businessdelegate.ManualStatLoadBusinessDelegate.submitStatItems(ManualStatLoadBusinessDelegate.java:86)
at com.americanexpress.statdc.manual.handlers.InputterStatDataRequestHandler.processRequest(InputterStatDataRequestHandler.java:123)
at com.americanexpress.util.frontservlet.FrontServlet.processRequest(Unknown Source)
at com.americanexpress.util.frontservlet.FrontServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at com.americanexpress.statdc.infrastructure.filter.StatDCGZipFilter.doFilter(StatDCGZipFilter.java:59)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1064)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:598)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:206)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:80)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:214)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:623)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:447)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
This exception is occuring at the time of preparing the Callable Statement.
We are using WSAD 5.0.0 with JDK 1.3.1, Oracle thin driver for Oracle 9i.
Thanks in advance.
Regards,
SheshaHi,
This problem is caused by bug in the jdbc oracle driver:
oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
Line 431 looks like:
/* 431 */ if(m_items == null && i >= m_items.length) // it never works!
NullPointerException occures when you call
java.sql.CallableStatement.clearParameters()
1. Avoid to call this method in your code.
2. Websphere also calls this method in the WSJdbcConnection.class (while reusing the statement after caching it).
You may force websphere not to reuse your statement for example by adding timestamp to it as comment:
String timestamp = String.valueOf(System.currentTimeMillis());
String myCommand = "call myprocedure( ?, ?) -- " + timestamp);
conn.prepareCall(myCommand); -
JBO-26061, Null User Name and password not supported by thin driver
Hello !
I have just installed Oracle 8.1.6 on my Linux Box.My Jdeveloper is installed on Win 98 Box. Now I am trying to execute the Online Orders sample package provided with the Jdeveloper. I have followed the instructions provided with the Jdeveloper Tutorial sample. The test connection between the client and server are a success. The OnlineOrder test is also a success. When I run The Application.java Class then it is giving the
JBO-26061 error with details as Null user name and password not supported by thin driver.
Where I am wrong I dont understand. Pls guide?jdeveloper is certifed to run on the win nt AND win 200 platforms only.
Please read the "Install notes" file (install.htm) before proceeding further. -
Oracle (JDBC) Thin Driver Ora-00600 Error
Hi,
I'm using Oracle9i JDeveloper and trying to access an Oracle 9.2.0.2 database using the oracle thin driver.
Sometimes I get the error message "SQLException: ORA-00600: internal error code" when I execute queries. When I change the query to select smaller fields, it seems okay.
Can someone help me out with this?
Thanks,
Siu SemOra-600 errors typically are:
(1) Accompanied by subsequent error number information
in square brackets like:
ORA-600:[12345] [] [] [] []
(2) A server-side trace file written out
We need the additional information of that error number in brackets to help you more. -
Error in creating Connection Pool using Oracle Thin Driver
Hi,
I am trying to create a connection pool in WS 5.1 with sp #6 using Oracle Thin Driver (oracle.jdbc.driver.OracleDriver) on a Sun box. But I am able to create the pool using weblogic.jdbc.oci.Driver. I get an DBMS Driver exception when I use thin driver. I have LD library path and weblogic class path set correctly. WL shows the following exception :
weblogic.common.ResourceException: weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
Any help on this is greatly appreciated.
Thanks,
RamuHi Ramu,
Please post your connection pool setting here. You might have missed some
port/server info. The driver is unable to connect to the db server here.
sree
"Ramu" <[email protected]> wrote in message
news:3d5bbc3a$[email protected]..
>
Yes. I am trying to create a connection pool in weblogic and I have theweblogic
class path setup correctly. It points to classes111.zip andnls_charset11.zip.
>
-Ramu
"Neo Gigs" <[email protected]> wrote:
Did you setup the JDBC library classpath correctly?
For me, e.g. Oracle 7.3.4, the classpath should be:
export CLASSPATH = /oracle7.3.4/jdbc/lib/classes.zip:%CLASSPATH%
Noted that the JDBC classpath must be the first classpath element in
the export
statement.
Neo -
BLOB insert behavior with thin driver using standard JDBC2.0 and ORACLE-JDBC2.0API
We have a problem with a BLOB insert to an oracle 8.1.7 DB using Oracle 8.1.7 JDBC thin driver.We get socket read/write error after inserting 32k of data using the standard JDBC2.0 API but using the Oracle JDBC2.0API (using OracleResultSet) it goes fine. We have a requirement to use the standard JDBC2.0 so that our code works with multiple database vendors. Is there another way to get in the blob data with standard JDBC API & using thin driver...?
thanks,
Madhu
Here is my sample test program that does both standard & oracle specific JDBC Blob test insert.
import java.sql.*;
import java.io.*;
import oracle.sql.BLOB;
import oracle.jdbc.driver.OracleResultSet;
public class testBLOB {
//trying to insert a huge file to a BLOB
static String fileName = "/kernel/genunix";
public static void main(String[] args) {
String driverName = "oracle.jdbc.driver.OracleDriver";
String dbURL = "jdbc:oracle:thin:@localhost:1521:test"; //thin driver
String user = "BlobTest";
String passwd = "BlobTest";
Connection con=null;
try {
Class.forName(driverName);
con=DriverManager.getConnection(dbURL, user,passwd);
catch (Exception e) {
e.printStackTrace();
close(con);
int i = 0;
while (i < args.length) {
if (args.equals("-f"))
fileName = args[++i];
i++;
System.out.println("The file being Stored is: "+fileName);
createTable(con);
insertUsingOracleAPI(con);
insertUsingJDBC20API(con);
//readDB(con);
static String getFileName() {
return fileName;
public static void close(Connection con) {
try {
if (con != null) {
con.close();
catch (Exception e) {
System.exit(-1);
public static void createTable(Connection con) {
Statement stmt ;
try {
stmt = con.createStatement();
stmt.execute("DROP TABLE basic_blob_table");
stmt.close();
catch (SQLException sqlEx) {
System.out.println("Dropped the Table");
try {
stmt = con.createStatement();
stmt.execute("CREATE TABLE basic_blob_table ( x varchar2(30), b blob)");
stmt.close();
catch (SQLException sqlEx) {
sqlEx.printStackTrace();
close(con);
System.out.println("Created the Table");
public static void insertUsingOracleAPI(Connection con) {
OutputStream os = null;
Statement stmt = null;
ResultSet rs = null;
FileInputStream is = null;
try {
con.setAutoCommit(false);
stmt = con.createStatement();
stmt.execute("INSERT INTO basic_blob_table VALUES( 'OracleAPI', empty_blob())");
System.out.println("Inserted the dummy Row");
rs = stmt.executeQuery("Select * from basic_blob_table where x='OracleAPI'");
if (rs != null && rs.next()) {
BLOB blob = ((OracleResultSet)rs).getBLOB(2);
File file = new File(getFileName());
is = new FileInputStream(file);
os = blob.getBinaryOutputStream();
byte[] chunk = new byte[1024];
int length = -1;
while((length = is.read(chunk)) != -1)
os.write(chunk, 0,length);
System.out.println("Inserted the File " + getFileName() );
catch (Exception e) {
e.printStackTrace();
finally {
try {
if (os != null) {
os.flush();
os.close();
if (is != null)
is.close();
stmt.close();
con.commit();
con.setAutoCommit(true);
catch (Exception e) {}
public static void insertUsingJDBC20API(Connection con) {
PreparedStatement stmt = null;
FileInputStream is = null;
try {
stmt = con.prepareStatement("INSERT INTO basic_blob_table VALUES(?,?)");
File file = new File(getFileName());
is = new FileInputStream(file);
stmt.setString(1,"JDBC20API");
stmt.setBinaryStream(2,is,(int)file.length());
stmt.executeUpdate();
catch (Exception e) {
e.printStackTrace();
finally {
try {
if (is != null)
is.close();
stmt.close();
catch (Exception e) {}
nullThanks for the response.
I understand what you are saying...
that readers don't block writers in Oracle (the same is true in SQL Server 2000).
However, I don't see how my test case is working correctly with Oracle (the exact same code acting as I'm thinking it should with SQL Server, but I still think it is acting incorrectly with Oracle).
I have transaction A do this:
update <table> set <column2>=<value> where <column1>='1'
then I use Thread.sleep() to make that program hang around for a few minutes.
Meanwhile I sneak off and start another program which begins transaction B. I have transaction B do this:
select * from <table> where <column1>='1'
and the read works immediately (no blocking... just as you have said) however, transaction A is still sleeping, it has not called commit() or rollback() yet.
So what if transaction A were to call rollback(), the value read by transaction B would be incorrect wouldn't it ?
Both A and B use setAutoCommit(false) to start their transactions, and then call setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED).
Isn't that supposed to guarantee that a reader can only read what is committed ?
And if a row is in "flux"... in the process of having one or more values changed, then the database cannot say what the value will be ?
I can almost see what you are saying.
In letting the reader have what it wants without making it wait, I suppose it could be said that Oracle is holding true to the "only let committed data be read"
So if that's it, then what if I want the blocking ?
I want an entire row to be locked until whoever it in the middle of updating, adding, or removing it has finished.
Do you know if that can be done with Oracle ? And how ?
Thanks again for helping me. -
8.1.6 thin driver and Netscape plug in 1.2.2
Hi.
I'm trying to use the latest Oracle thin driver in an applet
using Netscapes plug-in 1.2.2.
I am getting the error below when I call
DriverManager.getConnection
The error seems to be a security error.
The code and driver works fine in a standalone application under
JDK 1.2.
The database I am connecting to is the same machine as the web
server and I am not using a firewall so there should be no
security violations. I have tried using both DNS name and IP
address for the target machine but I always get the same error.
Has anyone been able to use the 8.1.6 thin driver in an applet on
Netscape?
Thanks in advance, Sean.
-------Error message ------
java.lang.ExceptionInInitializerError:
java.security.AccessControlException: access denied
(java.util.PropertyPermission JdbcTrace read)
at
java.security.AccessControlContext.checkPermission(Unknown
Source)
at java.security.AccessController.checkPermission(Unknown
Source)
at java.lang.SecurityManager.checkPermission(Unknown
Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown
Source)
at java.lang.System.getProperty(Unknown Source)
at
oracle.jdbc.driver.OracleLog.<clinit>(OracleLog.java:604)
at
oracle.jdbc.dbaccess.DBConversion.<init>(DBConversion.java:87)
at
oracle.jdbc.ttc7.TTCConversion.<init>(TTCConversion.java:75)
at
oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1126)
at
oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:182)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:
156)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDrive
r.java:231)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:208)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at JDBCTest.init(JDBCTest.java:10)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
nullIt appears that your may be turning tracing on which is in turn requiring access to properties on the local file system. Use JDK 1.2.2's policytool to add a policy for either the Codebase, or sign your applet and then by Codebase and Sign By, adding a PropertyPermission, A Target of *, and an Action of read.
-
Memory leak in weblogic 6.0 sp2 oracle 8.1.7 thin driver
Hi,
I have a simple client that opens a database connection, selects from
a table containing five rows of data (with four columns in each row)
and then closes all connections. On running this in a loop, I get the
following error after some time:
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
<OutOfMemoryError in
Adapter
java.lang.OutOfMemoryError
<<no stack trace available>>
>
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
failed
java.lang.OutOfMemoryError
I am running with a heap size of 64 Mb. The java command that runs
the client is:
java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
-Djava.naming.f
actory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=
t3://garlic:7001 -verbose:gc Test
The following is the client code that opens the db connection and does
the select:
import java.util.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class Test {
private static final String strQuery = "SELECT * from tblPromotion";
public static void main(String argv[])
throws Exception
String ctxFactory = System.getProperty
("java.naming.factory.initial");
String providerUrl = System.getProperty
("java.naming.provider.url");
Properties jndiEnv = System.getProperties ();
System.out.println ("ctxFactory : " + ctxFactory);
System.out.println ("ProviderURL : " + providerUrl);
Context ctx = new InitialContext (jndiEnv);
for (int i=0; i <1000000; i++)
System.out.println("Running query for the "+i+" time");
Connection con = null;
Statement stmnt = null;
ResultSet rs = null;
try
DataSource ds = (DataSource) ctx.lookup
(System.getProperty("eaMDataStore", "jdbc/eaMarket"));
con = ds.getConnection ();
stmnt = con.createStatement();
rs = stmnt.executeQuery(strQuery);
while (rs.next ())
//System.out.print(".");
//System.out.println(".");
ds = null;
catch (java.sql.SQLException sqle)
System.out.println("SQL Exception : "+sqle.getMessage());
finally
try {
rs.close ();
rs = null;
//System.out.println("closed result set");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
stmnt.close ();
stmnt = null;
//System.out.println("closed statement");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
con.close();
con = null;
//System.out.println("closed connection");
} catch (Exception e) {
System.out.println("Exception closing connection");
I am using the Oracle 8.1.7 thin driver. Please let me know if this
memory leak is a known issue or if its something I am doing.
thanks,
rudyRepost in JDBC section ... very serious issue but it may be due to Oracle or
to WL ... does it happen if you test inside WL itself?
How many iterations does it take to blow? How long? Does changing to a
different driver (maybe Cloudscape) have the same result?
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"R.C." <[email protected]> wrote in message
news:[email protected]...
Hi,
I have a simple client that opens a database connection, selects from
a table containing five rows of data (with four columns in each row)
and then closes all connections. On running this in a loop, I get the
following error after some time:
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
<OutOfMemoryError in
Adapter
java.lang.OutOfMemoryError
<<no stack trace available>>
>
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
failed
java.lang.OutOfMemoryError
I am running with a heap size of 64 Mb. The java command that runs
the client is:
java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
-Djava.naming.f
actory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=
t3://garlic:7001 -verbose:gc Test
The following is the client code that opens the db connection and does
the select:
import java.util.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class Test {
private static final String strQuery = "SELECT * from tblPromotion";
public static void main(String argv[])
throws Exception
String ctxFactory = System.getProperty
("java.naming.factory.initial");
String providerUrl = System.getProperty
("java.naming.provider.url");
Properties jndiEnv = System.getProperties ();
System.out.println ("ctxFactory : " + ctxFactory);
System.out.println ("ProviderURL : " + providerUrl);
Context ctx = new InitialContext (jndiEnv);
for (int i=0; i <1000000; i++)
System.out.println("Running query for the "+i+" time");
Connection con = null;
Statement stmnt = null;
ResultSet rs = null;
try
DataSource ds = (DataSource) ctx.lookup
(System.getProperty("eaMDataStore", "jdbc/eaMarket"));
con = ds.getConnection ();
stmnt = con.createStatement();
rs = stmnt.executeQuery(strQuery);
while (rs.next ())
//System.out.print(".");
//System.out.println(".");
ds = null;
catch (java.sql.SQLException sqle)
System.out.println("SQL Exception : "+sqle.getMessage());
finally
try {
rs.close ();
rs = null;
//System.out.println("closed result set");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
stmnt.close ();
stmnt = null;
//System.out.println("closed statement");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
con.close();
con = null;
//System.out.println("closed connection");
} catch (Exception e) {
System.out.println("Exception closing connection");
I am using the Oracle 8.1.7 thin driver. Please let me know if this
memory leak is a known issue or if its something I am doing.
thanks,
rudy -
Problem w/ 8.1.6 Thin Driver and Oracle 8.0.5
I am attempting to connect to two data hosts.
One is Oracle 8.1.6, the other is Oracle 8.0.5. The DB Admin insists the user name and passwords are the same for both.
I am using the v8.1.6 100% Java thin driver under both JDK v1.2 and v1.3. My OS is Windows2K Professional.
I can always connect to the 8.1.6 database but never to the 8.0.5 database under any circumstances. The error I receive when attempting to connect to the 8.0.5 database is:
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=134238208)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
Does any one have some insights here?
My test code fragment is as follows:
try{
Class.forName( "oracle.jdbc.driver.OracleDriver" ).newInstance();
String dbURL = "";
//dbURL = "jdbc:oracle:thin:@host1:1521:data_source_8_1_6";
dbURL = "jdbc:oracle:thin:@host2:1521:data_source_8_0_5";
Connection con = DriverManager.getConnection(dbURL, "test_user", "test_user");
java.sql.Statement stmt = con.createStatement();
String sq1String = "SELECT * FROM DUAL";
java.sql.ResultSet res = stmt.executeQuery(sq1String);
int rows = 0;
while(res.next()) {
rows++;
System.out.println("rows = " + rows);
catch(Exception e) {
System.out.println(e);
nulltnsping is working correctly. We can ping the host and it is listening on port 1521. Likewise, there are other applications inhouse using this datasource.
Since first posting my question, I have also tried running the test program on WinNT. Same problem arises.
Other suggestions? -
I have downloaded oracle 8.1.6.0 jdbc thin driver(named classes12.zip) to run with jdk1.3 to access oracle 8.0.5, but when I compile and run the jdbccheckup.java downloaded from oracle website like this:
javac -classpath d:\jdbc\classes12.zip jdbccheckup.java
(compile succeed)
java -classpath d:\jdbc\classes12.zip jdbccheckup
an error occured:
Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
Why??????Try this isntead.
java -classpath d:\jdbc\classes12.zip;. jdbccheckup
an error occured:
Exception in thread "main" java.lang.NoClassDefFoundError:jdbccheckup
Why?????? -
JDBC Development team quote:
You can download the JDK 1.2 version of the 8.1.6 Thin driver from this site. It is 100% Pure Java and will run on Linux.
As you replied, I downloaded 8.1.6 Thin driver(classes12.zip) and nls_charset12.zip. Then, as instructed in readme file of 8.1.6, I modified CLASSPATH and add LD_LIBRARY_PATH.
I wrote a test program, and it compiled without errors. But when I excuted it, I got the error message below:
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNU
M=135286784)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
Is there any other installation procedures I missed?
Below is the test program I used:
import java.sql.*;
import oracle.jdbc.driver.*;
public class Test
public static void main (String args [])throws SQLException
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
catch(ClassNotFoundException e){
System.out.println("Cannot load the Driver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@host:port:sid","id", "password");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select sysdate from dual");
while (rset.next ())
System.out.println (rset.getString (1));
I'd appreciate if you give me some insight.
nullIt seems like the database listener is not setup properly. Please double check the listener is up and it's listening to the port you specified.
Thanks.
Maybe you are looking for
-
Oracle Application Server 10G base release on AIX 5.1 L
We are having 2 AIX Servers with AIX 5L V5.1 working through cluster HACMP V 4.5 and Oracle Application Server 9.0.2.3 ported on one of its node se,because of the bug in the AS we have disabled the clustering services on the node porting the Applicat
-
HP Photosmart D110 won't connect. Keeps saying cannot find printer
I'm sorry if someone have posted this before but I don't know how to explain my problem. The printer was working fine the first few weeks we got it and now, it's becoming a hassle especially when I need to print review sheets for class in the morning
-
HT1926 Help,can't load itunes on my new windows 8 laptop?
Help, can't load itunes on to my new laptop, which runs windows 8. Any ideas?
-
Hello Gurus, please what is the steps and details for lifecycle of SD project? or please show me where I can find relevant document for that? Many thanks, cindy
-
Adobe Form - Path of the context field from the object pallate
Hi, I am trying to modify the standard adobe(MR_PRINT_INSERS) form as per the requirement. There are many tables and fields in the context. I want to know the path to which the the UI elements(library pallate) are binded. I can see the field name in