Throws Exception when jdbc connect to Oracle
Hi! I'm waiting for your answers.
When i use jdbc to connect Oracle,system throws exceptions as follows:
java.lang.ClassCastException: oracle.sql.converter.CharacterConverter12Byte
oracle.sql.CharacterSet1Byte oracle.sql.CharacterSet1Byte.getInstance (int,racle.sql.converter.CharacterConverter)
CharacterSet1Byte.java:82
oracle.sql.CharacterSet oracle.sql.CharacterSetWithConverter.getInstance(int) CharacterSetWithConverter.java:85
I code in Oracle9i Jdeveloper 9.0.2. The Oracle version is 9.0.2.
My code example is as follows:
package mypackage2;
import java.sql.*;
import oracle.jdbc.driver.*;
public class Class1
public Class1()
public static void main(String[] args)
Class1 class1 = new Class1();
Connection conn = null;
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//exception throws in getConnection()
conn = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:CR","system","CR2001");
catch (Exception e)
e.printStackTrace();
import java.io.*;
import java.sql.*;
import java.text.*;
import oracle.jdbc.driver.*;
public class viewtable
Connection con;
Statement st;
public viewtable (String args[]) throws ClassNotFoundException,FileNotFoundException,IOException,SQLException
url="jdbc:oracle:thin:system/manager@IP:1521:SID";
Class.forName ("oracle.jdbc.driver.OracleDriver");
try
con=DriverManager.getConnection(url);
st = con.createStatement ();
doexample ();
st.close ();
con.close ();
}catch(SQLException e)
System.err.println(e.getMessage());
public void doexample () throws SQLException
ResultSet rs = st.executeQuery("select * from sales");
if(rs!=null) {
while(rs.next())
int a = rs.getInt("no"); System.out.println("NO = "+a);
rs.close();
public static void main (String args[])
System.out.println ("Oracle Exercise 1 \n");
try
viewtable test = new viewtable(args);
} catch (Exception ex)
System.err.println ("Exception caught.\n"+ex);
ex.printStackTrace ();
the above is the full code, please check the problem....many thanks
Similar Messages
-
ADF application on cluster throw exception when using chrome
I deploy my ADF application to cluster with one proxy server (myip:7003) and two application server(myip:7004 myip:7005) ( http://docs.oracle.com/cd/E15051_01/wls/docs103/cluster/setup.html )
It works fine when using firefox and IE8, but throw exception when using chrome
####<Mar 1, 2013 3:18:30 PM CST> <Notice> <Diagnostics> <XXX.XXX.com> <server02> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1362122310439> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'server02' has triggered at Mar 1, 2013 3:18:30 PM CST. Notification details:
WatchRuleType: Log
WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
WatchData: DATE = Mar 1, 2013 3:18:30 PM CST SERVER = server02 MESSAGE = [ServletContext@710669610[app:Project1 module:XXX path:/XXX spec-version:2.5]] Servlet failed with Exception
java.lang.NullPointerException
at org.apache.myfaces.trinidad.model.BaseMenuModel.setRowKey(BaseMenuModel.java:120)
at org.apache.myfaces.trinidad.component.UIXTree.createCollectionModel(UIXTree.java:274)
at org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1513)
at org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1115)
at org.apache.myfaces.trinidad.component.UIXTree$RowKeyFacesBeanWrapper.getProperty(UIXTree.java:423)
at org.apache.myfaces.trinidad.component.UIXComponentBase.getProperty(UIXComponentBase.java:1485)
at org.apache.myfaces.trinidad.component.UIXTree.getDisclosedRowKeys(UIXTree.java:626)
at org.apache.myfaces.trinidad.component.UIXTree.__init(UIXTree.java:325)
at org.apache.myfaces.trinidad.component.UIXCollection._init(UIXCollection.java:1778)
at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:589)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeFacet(DecorativeBoxRenderer.java:440)
at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer._encodeCenterPane(DecorativeBoxRenderer.java:704)
at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeAll(DecorativeBoxRenderer.java:380)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:263)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1593)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:279)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:68)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = XXX.XXX.com TXID = CONTEXTID = TIMESTAMP = 1362122310438
WatchAlarmType: AutomaticReset
WatchAlarmResetPeriod: 30000 Jdeveloper 11.1.2.1.0
webloigc 10.3
Please help me , thank you
Edited by: Rocky.c.Xu on 2013-3-1 上午2:52Solved it on my own.
The sso from Java->ABAP was OK
I reconfigured the sso from ABAP->JAVA by creating new ABAP certificate and import it to the J2EE.
Omri -
JDBC connect to Oracle, IO exception, Help!
I am trying to connect to Oracle server via JDBC, but encountered IO exception problem, could anyone provide me any help? code is as follows:
String url ="jdbc:oracle:thin:@IP:1521:oracleSID"
Class.forName ("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection (url,usr,pwd);
the exception info is:
java.sql.SQLException:IOException: The network adapter could not establish the connection
require for help to solve this problem, many thanks!import java.io.*;
import java.sql.*;
import java.text.*;
import oracle.jdbc.driver.*;
public class viewtable
Connection con;
Statement st;
public viewtable (String args[]) throws ClassNotFoundException,FileNotFoundException,IOException,SQLException
url="jdbc:oracle:thin:system/manager@IP:1521:SID";
Class.forName ("oracle.jdbc.driver.OracleDriver");
try
con=DriverManager.getConnection(url);
st = con.createStatement ();
doexample ();
st.close ();
con.close ();
}catch(SQLException e)
System.err.println(e.getMessage());
public void doexample () throws SQLException
ResultSet rs = st.executeQuery("select * from sales");
if(rs!=null) {
while(rs.next())
int a = rs.getInt("no"); System.out.println("NO = "+a);
rs.close();
public static void main (String args[])
System.out.println ("Oracle Exercise 1 \n");
try
viewtable test = new viewtable(args);
} catch (Exception ex)
System.err.println ("Exception caught.\n"+ex);
ex.printStackTrace ();
the above is the full code, please check the problem....many thanks -
Getting Exception in jdbc connection got from DataSource in Oracle AS
Hi
i am using data source in my application.
When my application is invoked it gets the jdbc connection from the data source, performs set of operations and then releases the connection.
But if the application is invoked after a long time e.g. 10 hours then i get the following exceptions which i have logged:
Io exception: Connection reset
and the other exception is given below:
Closed Connection
The data-sources.xml is as follows:
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
<data-sources>
<data-source
name="MYDS"
class="oracle.jdbc.pool.OracleConnectionCacheImpl"
location="jdbc/myDSCON"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="xxxxxxxx"
password="xxxxxxxx"
url="jdbc:oracle:thin:@localhost:1521:orcl"
inactivity-timeout="30"
max-connections="100" >
<property name="cacheScheme" value="1" />
</data-source>
</data-sources>
Please let me know what is wrong with my application or configuration setting or something is wrong with oracle application server.Hi,
I found one solution which is for 10.1.2.x and i am using Oc4j 10.1.3.1 but solution is below
Solution
There is a new setting called "ValidateConnections" from 10.1.2.x. This setting will make sure to check the validity of the connections before it is assigned to the application.
1. Download and apply the patch for unpublished bug 4305639 for your current 10.1.2.x version. If a patch is not already available then please submit a backport request to get the patch to your version.
2. Set the command line option "-DValidateConnections=true" and restart the container. This can be set via EM AS control or by manually updating opmn.xml file. After the changes the options should look like
<process-type id="oc4j_test1" module-id="OC4J">
<module-data>
<category id="start-parameters">
<data id="java-options" value="-server -Djava.security.policy=/opt/oracle/jw101202/j2ee/oc4j_test1/config/java2.policy -Djava.awt.headless=true -DValidateConnections=true" />
<data id="oc4j-options" value="-properties"/>
Regards, -
Hi All,
I hope someone will help me.
I am trying to connect to Oracle 8i using the JDBC "thin" driver on Windows 2000 prof. The program is compiled successfully but got error "ClassNotFoundException: Unable to find class oracle.jdbc.driver.OracleDriver" when try to run. Please see code below for your review:
import java.io.*;
import java.sql.*;
import java.net.*;
import java.lang.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class emp extends HttpServlet
public void doGet(
HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
res.setContentType("Text/html");
PrintWriter out = res.getWriter();
out.println("<HTML>");
out.println("<TITLE>Simple Emp Details</TITLE>");
out.println("<BODY BGCOLOR=\"#FFFFFF\">");
out.println("<CENTER><B>Employees</B></CENTER>");
out.println("<BR>");
Connection conn = null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@satya:1521:satya", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT ENAME, JOB FROM EMP");
while(rs.next())
out.println("<BR>");
out.println(rs.getString("ENAME") + " - " + rs.getString("JOB"));
out.println("<BR>");
out.println();
catch(SQLException ex)
out.println("SQL EXception: " + ex.getMessage() + "<BR>");
while((ex = ex.getNextException()) != null)
out.println(ex.getMessage() + "<BR>");
catch(ClassNotFoundException clsex)
out.println("ClassNotFoundException: " + clsex.getMessage() + "<BR>");
finally
if(conn != null)
try
conn.close();
catch(Exception ignored) {}
out.println("</BODY></HTML>");
Can you please also give me precise syntax and explanation for DriverManager.getConnection i.e. DriverManager.getConnection("jdbc:oracle:thin:@satya:1521:satya", "scott", "tiger");
Many thanks in advance for your great cooperation,
SatyaThe error is caused by the runrime VM not finding the Oracle JDBC driver. You need to make sure that the file containing the driver (usually classes12.zip) is in the classpath of your application server. Check the doco that comes with your app server to learn how to set this up.
For info about the parameters to getConnection() for Oracle see the Oracle JDBC developers guide and reference.
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/basic1.htm#1000881
Since you appear to be using a J2EE app server you'll probably want to use the JDBC connection pooling it supplies rather than DriverManager.getConnection(). Check out the doco that comes with your app server and read the section about DataSource here http://developer.java.sun.com/developer/Books/JDBCTutorial/index.html -
HELP! Jdbc connection to oracle ClassNotFoundException classpath issues..
Okay I am a newbie to this but all the other posts concerning this just say add the classes12.jar to my classpath.
I am using websphere 5.0
connecting to a 9i db.
after trying to find out what my classpath is ( websphere 5.0 makes it difficult to see it) i found this:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="var"
path="SERVERJDK_50_PLUGINDIR/jre/lib/rt.jar"
rootpath="SERVERJDK_SRCROOT" sourcepath="SERVERJDK_50_PLUGINDIR/src.jar"/>
<classpathentry kind="src" path="Java Source"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/j2ee.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/servletevent.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/ivjejb35.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/runtime.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/string.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jaxen-full.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/utility.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jspsql.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/xalan.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/datetime.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/mailer.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/dom.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jstl.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/standard.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jdbc2_0-stdext.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/saxpath.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/sax.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/dbbeans.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jaxp-api.jar"/>
<classpathentry kind="lib" path="C:/oracle/ora92/jdbc/lib/classes12.jar"/>
<classpathentry kind="output" path="Web Content\WEB-INF\classes"/>
</classpath>
to me it looks like it is in my classpath.. (if thats what this is).
I have imported the classes12.jar file several times through out my project to no avail.
the error i get it here:
Error: It Screwed up agian java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
SystemOut O Connecting ... cisinv
Error: java.sql.SQLException: No suitable driver
SystemErr R Exception: null
from this code:
package Business;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
* @author jeffreak
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
public class beanDbConnect {
* Constructor for beanDbConnect.
public beanDbConnect() {
super();
private Connection con = null;
private Statement cmd = null;
private ResultSet rs = null;
public Connection connect()
//Declare variable
boolean blnSuccessfulOpen = false;
Driver driver;
String driverName;
String serverAddress;
//Begin try block
try
//Load JdbcOdbcDriver
driverName = "oracle.jdbc.driver.OracleDriver";
//oracle.jdbc.driver.OracleDriver
System.out.println("Loading ..." + driverName);
//try{
Class.forName(driverName).newInstance();
//catch (Exception err)
// System.err.println("Error: new instance: " + err.toString());
System.out.println("Database loaded successfully");
//catch (ClassNotFoundException e)
catch (Exception e)
System.err.println("Error: It Screwed up agian " + e.toString());
blnSuccessfulOpen = false;
try
//Instantiate connection to bean-defined DSN
//serverAddress = ("jdbc:oracle:thin:scott/tiger@localhost:1243:" + dbInstance);
System.out.println("Connecting ... " );
String serverName = "**********";//changed for post
String portNumber = "1521";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + "cisinv";
con = DriverManager.getConnection(url, "scott", "tiger");
System.out.println("Ready.");
blnSuccessfulOpen = true;
catch (SQLException e)
System.err.println("Error: " + e.toString());
//End try block
return con;
}//end connect()
Please help. ive been working on it for days =(.If you're running a Web app, put all JARs that your app needs in the WEB-INF/lib directory. That's always in the CLASSPATH.
I don't know WebSphere. Do you really have to edit something to add all those CLASSPATH entries?
In Tomcat, all I'd have to do is put a WAR file in the webapps directory.
Your code needs some work. You're not following Sun's Java coding standards. Capitalize your class name, for starters.
Is the username and password for your database still "scott" and "tiger"? Nice security there.
Your connect method makes a database connection. Do you leave it to users to close it? (You do close your connections when you're done with them, don't you?)
I'd make Connection a data member and create it in a constructor. I'd write a close method to close it up.
Doesn't WebSphere do connection pooling? Do you really want to write your own class to handle this?
MOD -
"No more data to read from socket" exception when testing connections
Hi,
I will appriciate your help with the following problem.
We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001128> <Connection for pool "oraclePool" closed.>
####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception: "java.sql.SQLException: No more data to read from socket".>
####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool": java.sql.SQLException: Io exception: Broken pipe.>
These exception occures every hour after the connection pool is being closed and refreshed.
Also there are a lot of the follwoing warnning in the log :
<BEA-001074><A JDBC pool connection leak was detected.
Does these two problems connected? What can we do in order to solve it?
Thanks
Edited by RF123 at 01/28/2007 3:41 AMR F wrote:
Hi,
I will appriciate your help with the following problem.
We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>
<> <BEA-001128> <Connection for pool "oraclePool" closed.>
####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
<> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
<> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception:
"java.sql.SQLException: No more data to read from socket".>
####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
<> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool":
java.sql.SQLException: Io exception: Broken pipe.>
These exception occures every hour after the connection pool is being closed and refreshed.
Also there are a lot of the follwoing warnning in the log :
<BEA-001074><A JDBC pool connection leak was detected.
Does these two problems connected? What can we do in order to solve it?Hi. The problems are not directly related, but may have the same cause.
Something is killing your DBMS connections out from under the driver.
Do you have a firewall between WLS and the DBMS, or a flakey network?
Contact BEA support to get the 8.1sp2 patch for getting meaningful
connection leak traces (CR209251_81sp2.jar). When that patch is installed
the leak messages should show a full stack trace of the application code
where the connection was obtained. It is that application code that
somehow failed to close the pool connection, causing a pool leak. I
suspect that the application code got an unexpected exception, such as
when/if the DBMS/network/firewall killed a connection. In this case I
believe the application went through an exception-handling path that
forgot to close the connection.
Joe -
JDBC Connectivity to Oracle 8i Database
I'am facing problem in connecting to Oracle 8i server using oci8 JDBC driver provided by Oracle.
The statemnet that gives me error is --
Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + "MIS", "scott", "tiger");
This throws an exception
java.lang.UnsatisfiedLinkError : make_c_state.
Can anyone please tell me where i'am going wrong?
Thanx in advanceReally need to know the platform on which you're trying to execute the code. Each client will need to have the standard Oracle client software installed (with the NET8 configuration application, which provides the 'drivers')
On Oracle's metalink see some responses
http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=121922.1
Overview
This example provides a minimal test program used to verify that the client
environment is set up properly for running the JDBC OCI driver in order to avoid
receiving the 'unsatisfied link error' caused by an incorrect LD_LIBRARY_PATH.
Program Notes
Simply copy the code below to a file called Test.java. Compile and run the
file from the client environment that you intend to use for your JDBC
applications.
References
[NOTE:118756.1]
Caution
The sample program in this article is provided for educational purposes only
and is NOT supported by Oracle Support Services. It has been tested
internally, however, and works as documented. We do not guarantee that it
will work for you, so be sure to test it in your environment before relying
on it.
Program
- - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - - - - - -
public class Test {
public static void main (String [] args)
try
System.loadLibrary("ocijdbc8");
System.out.println("Successfully Loaded");
} catch(Exception e)
System.out.println("LD_LIBRARY_PATH is not properly set");
e.printStackTrace();
- - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - - - - - -
http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=118756.1
which is:
I'm getting Unsatisfied Link Error with Oci 8 Driver ?
First, make sure that the jdbc-oci shared object (libocijdbc8 or liboci80Xjdbc.so etc.) and ${ORACLE_HOME}/lib are in your path. Then, try this Sample Program. Some times, even after the shared object is loaded successfully, you may get errors such as make_c_state symbol not found. This may happen if your CLASSPATH has classes.zip from JRE 1.1.7 or JDK 1.1.6 and your running java binaries from jdk 1.1.3 or so. Make sure everything (LD_LIBRARY_PATH, CLASSPATH, java binaries) is in SYNC. -
Hi,
I am making an application on swings and that would involve the connection to oracle 9i DB.
How do I do it and where can I get the driver for oracle.
This is urgent.
ThanksGoogle for "Oracle JDBC download". You might have to register to get their JDBC driver. Make sure you have the version that matches your JDK. If you're running JDK 1.4 or higher you'll want ojdbc14.jar.
As far as how to do it goes, you'll want to look at a JDBC tutorial.
Or this:
import java.sql.*;
import java.util.*;
* Command line app that allows a user to connect with a database and
* execute any valid SQL against it
public class DataConnection
public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
public static final String DEFAULT_URL = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\Edu\\Java\\Forum\\DataConnection.mdb";
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
public static final String DEFAULT_DRIVER = "com.mysql.jdbc.Driver";
public static final String DEFAULT_URL = "jdbc:mysql://localhost:3306/hibernate";
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
/** Database connection */
private Connection connection;
* Driver for the DataConnection
* @param command line arguments
* <ol start='0'>
* <li>SQL query string</li>
* <li>JDBC driver class</li>
* <li>database URL</li>
* <li>username</li>
* <li>password</li>
* </ol>
public static void main(String [] args)
DataConnection db = null;
try
if (args.length > 0)
String sql = args[0];
String driver = ((args.length > 1) ? args[1] : DEFAULT_DRIVER);
String url = ((args.length > 2) ? args[2] : DEFAULT_URL);
String username = ((args.length > 3) ? args[3] : DEFAULT_USERNAME);
String password = ((args.length > 4) ? args[4] : DEFAULT_PASSWORD);
System.out.println("sql : " + sql);
System.out.println("driver : " + driver);
System.out.println("url : " + url);
System.out.println("username: " + username);
System.out.println("password: " + password);
db = new DataConnection(driver, url, username, password);
System.out.println("Connection established");
Object result = db.executeSQL(sql);
System.out.println(result);
else
System.out.println("Usage: db.DataConnection <sql> <driver> <url> <username> <password>");
catch (SQLException e)
System.err.println("SQL error: " + e.getErrorCode());
System.err.println("SQL state: " + e.getSQLState());
e.printStackTrace(System.err);
catch (Exception e)
e.printStackTrace(System.err);
finally
if (db != null)
db.close();
db = null;
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection() throws SQLException,ClassNotFoundException
this(DEFAULT_DRIVER, DEFAULT_URL, DEFAULT_USERNAME, DEFAULT_PASSWORD);
* Create a DataConnection
* @throws SQLException if the database connection fails
* @throws ClassNotFoundException if the driver class can't be loaded
public DataConnection(final String driver,
final String url,
final String username,
final String password)
throws SQLException,ClassNotFoundException
Class.forName(driver);
this.connection = DriverManager.getConnection(url, username, password);
* Get Driver properties
* @param database URL
* @return list of driver properties
* @throws SQLException if the query fails
public List getDriverProperties(final String url)
throws SQLException
List driverProperties = new ArrayList();
Driver driver = DriverManager.getDriver(url);
if (driver != null)
DriverPropertyInfo[] info = driver.getPropertyInfo(url, null);
if (info != null)
driverProperties = Arrays.asList(info);
return driverProperties;
* Clean up the connection
public void close()
close(this.connection);
* Execute ANY SQL statement
* @param SQL statement to execute
* @returns list of row values if a ResultSet is returned,
* OR an altered row count object if not
* @throws SQLException if the query fails
public Object executeSQL(final String sql) throws SQLException
Object returnValue;
Statement statement = null;
ResultSet rs = null;
try
statement = this.connection.createStatement();
boolean hasResultSet = statement.execute(sql);
if (hasResultSet)
rs = statement.getResultSet();
ResultSetMetaData meta = rs.getMetaData();
int numColumns = meta.getColumnCount();
List rows = new ArrayList();
while (rs.next())
Map thisRow = new LinkedHashMap();
for (int i = 1; i <= numColumns; ++i)
String columnName = meta.getColumnName(i);
Object value = rs.getObject(columnName);
thisRow.put(columnName, value);
rows.add(thisRow);
returnValue = rows;
else
int updateCount = statement.getUpdateCount();
returnValue = new Integer(updateCount);
finally
close(rs);
close(statement);
return returnValue;
* Close a database connection
* @param connection to close
public static final void close(Connection connection)
try
if (connection != null)
connection.close();
connection = null;
catch (SQLException e)
e.printStackTrace();
* Close a statement
* @param statement to close
public static final void close(Statement statement)
try
if (statement != null)
statement.close();
statement = null;
catch (SQLException e)
e.printStackTrace();
* Close a result set
* @param rs to close
public static final void close(ResultSet rs)
try
if (rs != null)
rs.close();
rs = null;
catch (SQLException e)
e.printStackTrace();
* Close a database connection and statement
* @param connection to close
* @param statement to close
public static final void close(Connection connection, Statement statement)
close(statement);
close(connection);
* Close a database connection, statement, and result set
* @param connection to close
* @param statement to close
* @param rs to close
public static final void close(Connection connection,
Statement statement,
ResultSet rs)
close(rs);
close(statement);
close(connection);
}% -
Jdbc connection using oracle thin driver( using jdk1.4 and oracle8 )
hello ..
while i was tring to connection using oracle thin driver and jdk1.4 am getting the below error message. i have set the class path for the driver also. am using oracle8 personal edition and jdk1.4.
[java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Connexa.main(Connexa.java:18)[/b]
Press any key to continue...
my program is....
import java.sql.*;
import java.io.*;
import java.util.*;
import oracle.jdbc.driver.*;
// needed for new BFILE class
import oracle.sql.*;
public class Connexa {
public static void main (String args []) throws Exception {
Statement stmt=null;
try{
// Load the Oracle JDBC driver
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
// Connect to the database
// You can put a database name after the @ sign in the connection URL.
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl","scott","tiger");
//Connection conn =
// DriverManager.getConnection ("jdbc:odbc:datasource", "system", "manager");
stmt = conn.createStatement ();
catch (SQLException e)
e.printStackTrace();The code itself is fine; the problem is with one of:
1) the connection URL
2) intermediate networking
3) the database itself
1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
- is Oracle really running on the default port, 1521
- is the installation SID really "orcl"
2) lots of possibilities, but only a couple are likely
- is TCP/IP configured and running on your host
- is there a persoanl firewall rpduct running? perhaps it's blocking the connection
3) Is Oracle running?
Is the listener running? -
Error while creating a JDBC connection to Oracle 11g using WLS 6.1
Hi
I am trying to connect to Oracle 11g database on Weblogic 6.1 server.
First of all i would like to know if this is compatible?
The environement that i have is this
1. JDK 1.3
2. Database 11g is on remote system
3. Oracle client on my local system ( Connecting to the 11g DB through the client works fine)
4. Weblogic server 6.1
5. Currently the application is connected to Oracle 10g DB and working fine(We are attempting to move it to 11g)
Below are the steps that i followed to create the connection:
1. Made an entry for the datasource in config.xml under <WLS_DOMAIN>/config folder as below
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
MaxCapacity="4" Name="CADConnectionPool"
Properties="user=abc_proxy;password=proxy_abc;dll=ocijdbc8;protocol=thin"
RefreshMinutes="5" ShrinkPeriodMinutes="10" Targets="CAsvr"
TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
TestTableName="dual" URL="jdbc:oracle:thin:@gen11t-ora.db.lab.xyz.com:1530:GEN11T"/>
2. Restarted the server.
3. Ran the application and get the following error on the server console:
<Aug 22, 2011 12:39:42 AM CDT> <Error> <JDBC> <Cannot startup connection pool "C
ADConnectionPool" weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.lang.ArrayIndexOutOfBoundsException
at oracle.security.o3logon.C0.r(C0)
at oracle.security.o3logon.C0.l(C0)
at oracle.security.o3logon.C1.c(C1)
at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
elper)
at oracle.jdbc.ttc7.O3log.<init>(O3log.java:289)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:193)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:209)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
Can't load scjd12.dll, file not found java.library.path=C:\jdk1.3.1_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;.\bin;C:\P
rogram Files\Lotus\Notes\Data;C:\Program Files\Lotus\Notes;C:\Program Files\Java
\jre1.5.0_17\bin;C:\Program Files\Java\j2re1.4.2_06\bin;C:\Oracle\bin;C:\Program
Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\sys
tem32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\nls;C:\WINDOWS\sys
tem32\nls\ENGLISH;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Rational
\common;C:\Program Files\Rational\ClearCase\bin;C:\apache-ant-1.6.5\bin;C:\jdk1.
3.1_11\bin;C:\Program Files\Citrix\ICAService\;C:\Program Files\Citrix\System32\
;Z:.
<Aug 22, 2011 12:38:06 AM CDT> <Info> <JDBC> <Sleeping in createResource()>
<Aug 22, 2011 12:38:07 AM CDT> <Error> <JDBC> <Cannot startup connection pool "c
ispool" weblogic.common.ResourceException:
Could not load 'com.neon.jdbc.Driver
If this is a type-4 JDBC driver, it could occur if the JDBC
driver is not in the system CLASSPATH.
If this is a type-2 JDBC driver, it may also indicate that
the Driver native layers(DBMS client lib or driver DLL)
have not been installed properly on your system
or in your PATH environment variable.
This is most likely caused by one of the following:
1. The native layer SO, SL, or DLL could not be found.
2. The file permissions on the native layer SO, SL, or DLL
have not been set properly.
3. The native layer SO, SL, or DLL exists, but is either
invalid or corrupted.
For more information, read the installation documentation
for your JDBC Driver, available from:
http://e-docs.bea.com
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:212)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
Would like some help on this asap as the project is in critical stage.
ThanksThe driver being used by your weblogic is too old and incompatible with the DBMS. Upgrade the driver.
-
JDBC connection to Oracle 10g RAC periodically times out
I've been banging my head against the wall for months now and can't figure out why this is and what's causing it.
We have 6x CF8 servers in our environment. 3 of which work perfectly and the other 3 have the following problem. All 6 machines were installed at the same time and followed the exact same installation plan.
When I configure Oracle RAC data source, some of the machines time-out connecting to Oracle from time-to-time.
Config:
Solaris 9 on both CF and Oracle
CF8 Enterprise with the latest updater.
Apache 2 (not that it's relevant)
6 machines, load-balanced (not clustered), identical install and configuration.
data source config:
JDBC URL: jdbc:macromedia:oracle://10.0.0.3:1521;serviceName=dbname.ourdomain.com;AlternateServers= (10.0.0.4:1521);LoadBalancing=true
DRIVER CLASS: macromedia.jdbc.MacromediaDriver
The problem:
Every few minutes, CF starts hanging requests that deal with a specific RAC only data source. After about 30 seconds, all requests bail and generate this error in cfserver.log:
A non-SQL error occurred while requesting a connection from dbsource.
Timed out trying to establish connection
This happens with any RAC data source on the "bad" servers while the "good" servers don't have this problem. The "bad" server doesn't have any problems with direct (non-rac) Oracle data source.
Already tried:
Moving server connections around on a switch (rulling out bad switch port)
Copying driver from the healthy server (but it's the same installer anyway)
Changed from RAC to normal Oracle type data source - works perfectly. So at the moment I have 3 servers connecting to a specific oracle instance and the other 3 connecting to RAC.
Tried googling and searching forums and even Oracle metalink - nothing I could see relevant to this.
It's a shame that after spending a ton of money on CF8 upgrades and Oracle RAC, we can't really utilize fail-over on the database connection.
Any takers?
Thanks,
HenryI have the following in my CLASSPATH:
C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\jdbc.jar;
C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;
C:\Ora10g1\product\10.2.0\db_1\jlib\jndi.jar;
C:\Ora10g1\product\10.2.0\db_1\jlib\orai18n.jar;
Still 'Cannot find type 'oracle.jdbc.pool.OracleDataSource'
Thanks -
JDBC connection to Oracle 8.16 from Weblogic 6.1
I am trying to connect to an Oracle DB using the JDBC thin driver to Weblogic 6.1
I am getting the following error when starting up the Weblogic server:
"oracle.net.TNSAddress.SOException"
Anyone have an idea as to why I am getting this.
Thanks
Lathell McKellerIf the url fix does not work - try updating your jdbc drivers for oracle 8 (get the latest one). There is a chance that using the older oracle 7 drivers you might encounter some problems.
Regards,
Michael Bogecho -
Configuring RAC-aware JDBC connection in Oracle SQL Developer?
How can Oracle SQL Developer be configured to properly connect to an [Oracle RAC|http://en.wikipedia.org/wiki/Oracle_RAC] environment, I.E., not just setup to always connect to one of the individual nodes?
[http://programmersjournal.blogspot.com/2008/08/jdbc-connection-string-for-oracle-rac.html] has an example of a classic and the equivalent RAC-aware version of a JDBC connection string. I've already been using a RAC connection string of the same format from within custom Java applications without issue. I thought the same should be configurable in Oracle SQL Developer by setting the "Connection Type" drop-down to "Advanced", then entering the RAC-aware JDBC connection string as the "Custom JDBC URL". However, upon testing the connection, the following error is displayed at the bottom of the dialog:
Status : Failure -Test failed: Io exception: NL Exception was generated
There is no additional information shown on the "Logging Page" view. Using Oracle SQL Developer 1.5.5.
Thanks!Thanks, Barry. Just F.Y.I., it is working for me now that I upgraded to the 2.1 EA as -K- suggested. I had marked his reply as "Correct", but probably should have left a response indicating my success as well.
Now, if there's anything you could do regarding the [issues around the display performance of CLOBs, etc., in the Query Result view|http://forums.oracle.com/forums/message.jspa?messageID=3906571] , it'd be very appreciated! -
Problem in getting jdbc connection with oracle for win 98
This is my code given below
import java.sql.*;
public class Oconnection
Connection conn;
Statement st;
PreparedStatement pst,pstissue,pstret,pstbook;
public Oconnection()
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","manager");
catch(Exception ex)
System.out.println(ex.getMessage());
ex.printStackTrace();
public static void main(String args[])
new Oconnection();
*****************************************************8
Error
C:\Library>java Oconnection
Io exception: The Network Adapter could not establish the connection
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at Oconnection.<init>(Oconnection.java:17)
at Oconnection.main(Oconnection.java:39)
I am using Oracle for win95 or i think it is oarcleforwin98 .
The sid of my database i found through query given was orcl, what changes should i do in the code so that it works.
should i use another driver coz i am using latest driver from oracle.com which is for oracle 8i. if a need a driver change where can i download it from please help mehttp://forum.java.sun.com/thread.jsp?thread=291584&forum=48&message=1305045
Maybe you are looking for
-
Warning Messages when extracting Time Management Data using 0HR_PT_1,2
Hi, When extracting data using 0HR_PT_1 and 0HR_PT_2 extractors it comes up with the following errors and warnings even if the records in the source system are correct. "No Personel Work Schedule for personnel number XXXXXXX" and "Personnel number XX
-
THE OTHER PROBLEMS PRIOR TO THIS ARE 1. KEEPS LOCKING UP WHEN ON CERTAIN WEBSITES (YOU TUBE) 2.VERY SLOW PERFORMING TASKS I PURCHASED THIS PRODUCT FOR MY SONS THEY LOVE THE IMAC IN REGARDS TO SOFTWARE eg (IMOVIE ) BUT AS FAR AS THE PERFORMANCE THEY A
-
Is it possible to add a poster frame to video in HTML Resources
I have several videos that will be repeated throughout a folio, so I have made the HTML Resource zip containing them, how do I control the appearance? If I put a image behind the HTML Content and set the web overlay to transparent I just get a black
-
I recently purchased an ATV (in the USA - I live in Europe) and I notice that ATV doesn't seem to 'connect' to my TV, ie. the tv consistently shows 'no HDMI signal', or will sometimes show part of the relevant ATV menu screen momentarily and then dis
-
Querying data from the buffer_cache
Hi, I'm running an experiment on my own home database to understand how data is retrieved from the buffer_cache. Using Oracle 10g 10.2.0.3.0. I've populated 2 tables with 10million records each. The table structure is as follows. create table bigtabl