Note that there are some explanatory texts on larger screens.

plurals
  1. POJava database connectivity using weblogic server using type3 driver
    primarykey
    data
    text
    <p>Here i am doing the database connectivity using type3 driver using weblogic server and oracle database.</p> <p>I came across this error when i run my code</p> <pre><code>E:\abhishek\D drive\abhishek\advance\jdbc&gt;java Type3oracle Exception in thread "main" java.sql.SQLException: getConnection, Exception = Une xpected Exception at weblogic.jdbc.rmi.RMIWrapperImpl.invocationExceptionHandler(RMIWrappe rImpl.java:102) at weblogic.jdbc.rmi.Driver.connect(Driver.java:182) at Type3oracle.main(Type3oracle.java:21) Caused by: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception at weblogic.jdbc.common.internal.RmiDataSource_1030_WLStub.getConnection (Unknown Source) at weblogic.jdbc.rmi.Driver.connect(Driver.java:168) ... 1 more Caused by: java.rmi.UnmarshalException: Could not unmarshal method ID; nested ex ception is: java.rmi.UnmarshalException: Method not found: 'createQueryObject(Ljava. lang.Class&lt;LT;&gt;;)' at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234) at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef .java:348) at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef .java:259) ... 3 more Caused by: java.rmi.UnmarshalException: Method not found: 'createQueryObject(Lja va.lang.Class&lt;LT;&gt;;)' at weblogic.rmi.internal.MethodDescriptor.getCanonical(MethodDescriptor. java:197) at weblogic.rjvm.MsgAbbrevInputStream.getRuntimeMethodDescriptor(MsgAbbr evInputStream.java:495) at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:269 ) at weblogic.rmi.cluster.ClusterableServerRef.dispatch(ClusterableServerR ef.java:242) at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:1135) at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:1017) at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerSer ver.java:240) at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:882) at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection. java:453) at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:322) at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket. java:394) at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105) at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29) at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java: 42) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117) </code></pre> <p>Here is my code</p> <pre><code>import java.sql.*; import java.util.*; //weblogic.jar must be in the classpath and datasource with the specified name must be created and deployed and application server must be running //type 3 driver class Type3oracle { public static void main(String args[])throws Exception { Driver mydriver=(Driver)Class.forName("weblogic.jdbc.rmi.Driver").newInstance(); String url= "jdbc:weblogic:rmi"; Properties props =new Properties(); props.put("weblogic.server.url","t3://localhost:7001"); props.put("weblogic.jdbc.datasource","type3oracle"); //type3oracle is jndi name Connection con= mydriver.connect(url,props); Statement stmt = con.createStatement(); ResultSet rset=stmt.executeQuery("select * from student1"); while(rset.next()) { System.out.println(rset.getString(1)); } } } </code></pre> <p>please help me i want to run this program to connect to my table which is present in the database xe.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload