Create a jdbc connection within forms
I have created a little piece of java code that connects to my database via a jdbc connection, inserts a value into a table, commits, then closes the jdbc connection.
This works perfectly in JDeveloper.
Now, I need to use it within forms, but forms is throwing an exception in the java console: [I have signed the file]
and I also get an alert that says "FRM-92100: Your connection to the Server was interrupted. This may be the result of a network error or a failure on the Server. You will need to reestablish your session."
I'm assuming when my java code tries to do a jdbc connection, it conflicts with the already established forms connection. Does anyone have any suggestions on how to overcome this?
-----------------java console exception-----------------
java.lang.IllegalAccessException: myconnection
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at oracle.forms.handler.UICommon.instantiate Unknown Source)
at oracle.forms.handler.UICommon.onCreate(Unknown Source)
at oracle.forms.handler.ButtonItem.onCreate(Unknown Source)
at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)
at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
at oracle.forms.engine.Runform.onMessage(Unknown Source)
at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
at oracle.forms.engine.Runform.startRunform(Unknown Source)
at oracle.forms.engine.Main.createRunform(Unknown Source)
at oracle.forms.engine.Main.start(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
------------------java code-------------------------
NOTES: of course I have taken out the real ip
address, the db name, and the login and password.
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
import oracle.forms.ui.VButton;
class connection extends VButton
public static void main (String[] args) {
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url = "jdbc:oracle:thin:@<ip>:1521:<databasename>";
Connection conn = DriverManager.getConnection(url,"<login>","<password>");
Statement stmt = conn.createStatement();
ResultSet rs;
rs = stmt.executeQuery("insert into lh_test (my_name) values ('this')");
rs = stmt.executeQuery("commit");
conn.close();
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
Hi 348874,Frank
Frank,do you thinck that if this java class would extend VBean,instead of VButton will it make any diffence?(I mean,it do has a main method,wich isn't executed when the VButton initialises).
Ín fact,when having a closer look into the java class(wich ,obvioulsly I didn't last time) I'm quite confused...why is this exception raising?
This Component should do nothing in fact,when inserted into a form.
As far as I know,from Forms Applet point of view,this class should be exactly a VButton,because the constructor and init() method are exactly the ones inherited from VButton(This class isn't adding anything to VButton)...Am I wrong??
Similar Messages
-
Not possible to open/create a new connection within BT manager on Satellite M40
Bluetooh manager is open and present in system bar.
However it is never possible to open/create a new connection within bluetooth manager as it always say "bluetooh is not ready". Troubleshooting is required but no clear indication is available; button for wireless link is active and I am able to have wifi internet access at the same time.
It is never possible to open access to a PDA or mobile phone for file transfer through bluetooth.
Do i have to reload completely the bluetooth stack or is there another way to troubleshoot the bluetooh system?
Thanks you for replying if possible.Remove the Bluetooth Monitor software if it is installed. Download the latest BT-stack v5.10.06 here:
http://aps.toshiba-tro.de/bluetooth/redirect.php?page=pages/download.php
and install it. Ensure that the wireless switch is turned on and the suitable antenna is selected.
Press Fn+F8 key to select BT antenna. Selection menu only appears if WLAN and BT is inside.
Read the following if you should still have some problems:
http://aps.toshiba-tro.de/bluetooth/redirect.php?page=pages/faq/bluetoothnotworking.html -
APEX fails with Java stored procedure that creates a JDBC connection
Hello!
We are facing a strange problem since we have upgraded from Oracle 10g and Apache to Oracle 11g with Embedded Gateway.
Here is what we do:
** APEXX calls a PL/SQL package function "OPEN_CONNECTION" that wraps a Java stored procedure called "openConnection".*
FILE_READER_REMOTE_API.openConnection(user, password, host, port, service);
** The Java stored procedures "openConnection" opens a JDBC connection to an other database:*
public class FileReaderRemote {
private static Connection conn = null;
private static DefaultContext remoteContext = null;
public static void openConnection(String user, String password, String host, String port, String service) throws SQLException {
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
java.util.Properties props = new java.util.Properties();
props.put ("user", user);
props.put ("password", password);
//props.put ("database", "//" + host + ":" + port + "/" + service);
props.put ("database", host + ":" + port + ":" + service);
props.put("v$session.program", "FileReaderRemote2");
// Connect to the database
remoteContext = Oracle.getConnection("jdbc:oracle:thin:", props);
This procedure used to work fine before the upgrade, but now we see the following:
* It still works when called directly from TOAD or SQL*Plus, even under the user ANONYMOUS.
* When called from APEX and the target database is Oracle 11g, it still works.
* When called from APEX and the target database is Oracle 10g, it takes several minutes and we receive this error:
*"Socket read timed out"*
We have tested the following workaround:
We have created a database link to our own database and called the stored procedure through that database link.
FILE_READER_REMOTE_API.openConnection*@loopback*(user, password, host, port, service);
This works, but is not really an option.
I hope some one of you can explain this strange behaviour to me.
Best regards,
MatthiasYou wrote
"Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
From the Oracle8i Java Stored Procedures Developer's Guide
Release 8.1.5
A64686-01
"If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
"If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
DriverManager.getConnection("jdbc:oracle:kprb:");
Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
Connection conn =
DriverManager.getConnection(
System.getProperty("oracle.server.version") == null
? "jdbc:oracle:thin:@hostname:1521:ORCL"
: "jdbc:oracle:kprb:"),
"youruserid","yourpassword");
As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
Regards,
Steve
null -
Unable to create dynamic JDBC Connections in RMI Server
Hi,
Goal: Using Swing client to connect to a variety of JDBC databases via RMI dynamically....
J2SE : 1.4.2
J2EE: 1.31
Databases: Oracle 9i(R2), MySQL 4.0, MS Access 2000
Platform : Windows 2000 SP4 (Professional and Server)
I have a working client-server application using RMI to connect to a single database. I want the ability
to create JDBC connections dynmically by invoking a RMI method after it has been bound. Presently
I am getting null pointers. Anybody offer any solutions or work arounds?Goal: Using Swing client to connect to a variety of
JDBC databases via RMI dynamically....Actually what u want from the client swing is to form a Form using the datamodel from the database, invoke query as the client is allowed and wants and update changes. I hope I got it right, thats what u want.
Actually as per my knowledge goes thats what any Database 3-tier program should do.
I have a working client-server application using RMI
to connect to a single database. I want the ability
to create JDBC connections dynmically by invoking a
RMI method after it has been bound. Presently
I am getting null pointers. Anybody offer any
solutions or work arounds?Database connections are only needed as long as the query to the database are being processed. So for ur solution if u have a RMI method that, will invoke first, the database connection and then process the query and then disconnect it , would be enough. When multiple clients will call the method there will be multiple connections to the database as they can have threads working or if u want one process at a time u can sycronize the method. This RMI method will only return the result set of the query and that would be enough for ur solution. Now to be able to say why ur getting null pointers I would need the code u r using. -
Unable to create BI JDBC connection in JDeveloper
I'm trying to follow the steps in http://docs.oracle.com/cd/E28271_01/bi.1111/e10545/sql_bi_view_object.htm#BHAFJIHC to create JDBC connection. But when I click on Test, it shows Working.. and never returns with success or failure messages.
username: morgan.zu
password: Welcome1
BI Server Hostname: slcae097.us.oracle.com
BI Server Port: 10217
Meanwhile, I'm able to connect to http://slcae097.us.oracle.com:10217/analytics/ using the above credential. Any idea why it doesn't work in JDev?
Thanks,
JingHow about Oracle BI EE extensions? as mentioned in below link?
http://docs.oracle.com/cd/E28271_01/bi.1111/e10545/sql_bi_view_object.htm#BHADFIIB -
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.
-
Getting error while Creating a JDBC connection from Java Class
Hi,
I am getting the exception pasted below:
Exception in thread "main" java.lang.AbstractMethodError
at JvMakeVTable(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at JvPrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at JvWaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at oracle.jdbc.driver.OracleStatement.executeQuery(java.lang.String) (Unknown Source)
at oracle.jdbc.dbaccess.DBAccess.setNlsParamsClient(oracle.jdbc.driver.OracleConnection) (Unknown Source)
at oracle.jdbc.ttc7.TTC7Protocol.initNls(oracle.jdbc.driver.OracleConnection) (Unknown Source)
at oracle.jdbc.driver.OracleConnection.OracleConnection(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties) (Unknown Source)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties) (Unknown Source)
at oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
The code raising this error is :
try
Class.forName("oracle.jdbc.driver.OracleDriver");
catch (Exception Exp)
System.out.println("Error while getting the class : "+Exp);
try
String url = "jdbc:oracle:thin:@hostname:port:SID";
String user = "apps";
String password = "password";
con = DriverManager.getConnection(url,user,password);
catch (Exception ex)
System.err.println("SQLException: " + ex.getMessage());
Any help in this is appreciated.
Regards
JujaarWhy do you have the Class.forName() in a separate try-catch block than the DriverManager.getConnection()?
Try placing everything in the same try-catch block to see if that resolves your problem.
You may also want to try using an OracleDataSource.
OracleDataSource ods = new OracleDataSource();
String url = "jdbc:oracle:thin:@//hostname:port/SID",
ods.setURL(url);
ods.setUser("apps");
ods.setPassword("password");
Connection conn = ods.getConnection();
Refer to http://st-doc.us.oracle.com/11/111/java.111/b31224/getsta.htm#i1008334 for details on how to connect to the database using a Data Source. -
Problem closing sockets when using OCI8 JDBC connections
Hi,
We have a java thread that maintains a socket connection with a Telnet client. We are finding that this thread is unable to successfully close this connection with Socket.close(). The reason that close() fails appears to be that the same thread is creating an (OCI8 driver) JDBC connection via another Java object. If we don't create the JDBC connection within this thread the socket closes correctly.
Has anybody else experienced such problems?
We believe that this problem might be related to a BugRat report #391.
Cheers.
Max
nullSounds like a mis-match between the JDBC Drivers and the installed Oracle Client.
The JDBC Drivers with JDeveloper 9.0.3 should be the 9.0.1.3 versions (included with the iAS Admin Client and iAS 9.0.2)
Also note, the JDBC driver used by OC4J is "classes12dms.jar", not "classes12.jar"
Hope this helps,
Rob -
Create a view in the database based off a jdbc connection
I have some data in a DB2 database that I would like to union with a table in an Oracle Database in the Oracle Database.
Can I create a jdbc connection in the Oracle database that points to the DB2 database and then create a view based off of the jdbc connection?
I've never done anything like this , but if this a no brainer please just post a link or something that points me in the right direction thanks...
I've searched...Mark,
I was going to suggest the same thing as Jan did when she answered this question that you also posted to the Union DB2 and Oracle data in a view and display in a form using jdbc? forum.
Good Luck,
Avi. -
How can I check a jdbc connection
With Sun Java App Server, after I create a JDBC connection, I use a button to check if the connection was OK.
I cannot find the same button or method to see if my Sybase connection is correct because all I get is "is not bound in this Context".
I installed the sybase jdbc driver in the install_dir\lib_directory.
In the jdbc wizard I use the Sybase Driver: com.sybase.jdbcx.SybDataSource
TIA,
Lorenzo JimenezWith Sun Java App Server, after I create a JDBC connection, I use a button to check if the connection was OK.
I cannot find the same button or method to see if my Sybase connection is correct because all I get is "is not bound in this Context".
I installed the sybase jdbc driver in the install_dir\lib_directory.
In the jdbc wizard I use the Sybase Driver: com.sybase.jdbcx.SybDataSource
TIA,
Lorenzo Jimenez -
Javabean connection in Forms 10G
I am devolopping in Forms 10G and I want to connect to an informix database and execute on some queries.
A syou now ther is no odbc connection in Oraclae > 9i to others databases.
If someone has already Write a JDBC connection from Forms 10g to Informix, or a JavaBean to Implement this connection, Can You please Hep me.
It's Urgent
best regardsOracle Generic Connectivity and Transparent Gateways
Oracle offers two asychronous solutions for information integration: Oracle Generic Connectivity and Oracle Transparent Gateways. Generic connectivity addresses the needs of data access to many data stores for which Oracle does not have a gateway solution. This feature enables transparent connectivity using ODBC. Oracle Transparent Gateways provide the flexibility, power, and scalability to transparently access many non-Oracle data stores, including DB2, Informix, Microsoft SQL Server, Ingres and Sybase, from an Oracle environment.
There is all you want to connect, via an Oracle database, to your informix database.
Francois -
Can not deploy a report using JDBC connection on CR2008 Server
Hi Group,
I have a report created with JDBC connection. When I tried to add it to CR2008 server, it gives an error - "An unexpected error has occurred ". Basically I want to add a report to a public folder via CMC. I am using adminstrator account.
Then I thought I need to add JDBC driver into CR2008 server. so I put oracle jdbc jar into CR2008 server classpath and add JDBC connection info into CRConfig.xml. but I still got the same error.
I also tried:
- Change the report to use native Oracle driver rather than JDBC. The deployment succeeded (but this is not what I want)
- Add a data source connection via Business View Manager, but no luck.
I know how to use/change jdbc connection with programtic way, but I just want to know if I want to use built-in components in CR2008 server without any coding the reports can be deployed and managed.
Thanks in advance.
DennisHello Will,
Crystal Reports supports connections to JDBC/JNDI out of the box, and have done so for a while, whether stand-alone or published to Enterprise.
To specify where the server would search for the JDBC driver jar files, you'd change the classpath tag found in the CRConfig.xml file found on the machine where the Crystal Reports Page or Job Server is running.
For early Crystal Enterprise 10 and before, it used Java Native Interface (JNI) to start the Java process to retrieve the data from the JDBC connection.
For later Crystal Enterprise 10 and later, it starts off a "Java Server" process, and communicates to the Crystal Reports process via CORBA TCP/IP connection.
Commonissues that may arise: (1) CRConfig.xml not configured properly, (2) unable to start or communicate to the "Java Server" because of permissions or firewall.
Note that this is a separate connectivity map from using ADO or ADO.NET.
Sincerely,
Ted Ueda -
App Server 8.1 JDBC Connection problem
Dear Expert,
Cu are using Sun Java System Application Server Enterprise Edition 8.1. Cu created one jdbc connection pool and datasource. They are called
jdbc/RM
From the App Server Admin Console -> Connection Pool, cu can "Ping" the database via the connection pool.
Cu did the configuration on web.xml and sun-web.xml
web.xml
<resource-ref>
<description>Oracle Database Connection - Rawmart</description>
<res-ref-name>jdbc/RM</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
sun-web.xml
<resource-ref>
<res-ref-name>jdbc/RM</res-ref-name>
<jndi-name>jdbc/RM</jndi-name>
</resource-ref>
In customer class,
220: protected void initDataSource() throws NamingException {
221: initContext = new InitialContext();
222: envContext = (Context) initContext.lookup("java:comp/env");
223: String dataSource = rConfigObject.getConfigValue("DATASOURCE");
224: rDataSource = (DataSource) envContext.lookup(dataSource);
225: }Exception occurs on line no. 222 already.
From server.log, we get
================
#|2005-06-03T11:36:11.562+0800|WARNING|sun-appserver-ee8.1|javax.enterprise.system.stream.err|_ThreadID=10;|
javax.naming.NameNotFoundException: No object bound for java:comp/env [Root exception is java.lang.NullPointerException]
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:161)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.ns.DBObject.initDataSource(DBObject.java:222)
at com.ns.DBObject.connectPool(DBObject.java:213)
at com.ns.DBObject.<init>(DBObject.java:91)
at com.ns.DBObject.getInstance(DBObject.java:122)
at com.ncharter.NCContextListener.contextInitialized(NCContextListener.java:28)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4010)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4525)
===============
Do you have any ideas on this problem? Thanks.
Regards,
AngusTry asking the Customer to fire up the JNDI browser in the admin console and try to browse the JNDI tree.
What class is the InitialContext.lookup() happening in? Is that getting executed in the servlet class or a standalone client?
thanks. -
Jdbc connection in EJB using wsad 5.0
Hi,
I want to develop a small application using Ejbs by using oracle 9i as D/b, wsad 5.0 as app server . The problem is i am not able to connect to oracle database in WSAD. What i am doing is i have installed Oracle 9i in my system and has given the Global database name as "samp" while installation . I open my SQL plus with username scott and password tiger and i am able to do all my sql queries successfully.
Now coming to WSAD,
while creating a JDBC connection using Oracle 9i driver,
i ve opened in Data perspective and in that go to DB Servers -> Right click -> New Connection
There a window is opened for Database Connection.
We need to fill the fields there.
I have given samp as Global d/b name while installing Oracle 9i .
In the window , the feilds are
Connection Name : conn
Database Name : samp
user id : scott
password : tiger
D/b vendor type: Oracle 9i
Jdbc Driver : Oracle Thin Driver
Host : 127.0.0.1
port No: 1521
class location : c:\oracle\ora90\jdbc\lib\classes12.zip
connection url : jdbc:oracle:thin:@127.0.0.1:1521:samp
the class location and connection url are automatically coming.
and please check whether all fields are correct or not
Is this the correct way.
Next in code if i want to connect to database should i use connection establish commands again or i can directly use create statement or prepare statement.
Please reply.
ThanksCreate New Server and configure it properly
It will work
procedure is as follows:
Pls visit the following link:
http://www.webagesolutions.com/knowledgebase/waskb/waskb001/index.html
Adding a Oracle9i DataSource from WSAD5
Bibhas Bhattacharya, Web Age Solutions Inc.
Before you begin, make sure that you have Oracle installed and a database is created. In this document we will use a database called MALL.
Create a WAS V5 Server
If you don't already have a WebSphere V5 server created, do so following these steps. Switch to the Server perspective. Right click in the Server Configuration view and select New->Server and Server Configuration.
Name the server WASV5. Make sure that the Server type is set to WebSphere version 5.0->Test Environment. Click on Finish.
Add the Database User
In WSAD5, the default user ID and password to be used by a DataSource are first entered as a JAAS authentication entry.
In the Server Configuration view, double click on WASV5 to open the configuration editor. Click on the Security tab. Next to the JAAS Authentication Entries list click on Add and add the user.
Add the JDBC Driver
Still in the server configuration GUI click on the DataSource tab. You can add the DataSource at the server level or at the node level. We will add it at the server level. Make sure that the Server Settings is expanded. Next to the JDBC providers list click on Add.
Select the following options:
Database type: Oracle
JDBC provider type: Oracle JDBC Thin Driver or the XA version of it if you need two phase commit transaction.
Click on Next.
Set the name to Oracle Thin Driver.
Notice that the location of the driver's class is automatically set to ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip. Here, ORACLE_JDBC_DRIVER_PATH is a node level variable. We need to make sure that the variable is pointing to the correct directory where Oracle's JDBC driver is installed. In our case, we had installed Oracle in c:\oracle. This had installed the JDBC driver class in C:/oracle/ora81/jdbc/lib/classes12.zip.
In the server configuration GUI click on the Variables tab. Under the Node settings select ORACLE_JDBC_DRIVER_PATH from the Defined variables list. Click on Edit and set the value to C:/oracle/ora81/jdbc/lib.
Add the DataSource
Click on the DataSource tab again. Select the Oracle Thin Driver you had created in the previous step. Click on Add next to the Data source defined in the JDBC provider selected above list.
Select the following options:
Select the type of JDBC Driver: Oracle JDBC Thin Driver.
Select the data source type: Unless you will be testing your application with WAS V4, select Version 5.0. You can not use a V4 DataSource from a J2EE 1.3 EJB module running in WebSphere V5.
Click on Next.
Enter these key attributes in this screen:
Name: My Oracle DataSource
JNDI Name: jdbc/MyDataSource
DataSource helper class name: com.ibm.websphere.rsadapter.OracleDataStoreHelper. Should be selected by default. The helper class is needed if you wish to access IBM extensions to JDBC. For more details search in WSAD help for "WSDataSource interface".
Component-managed authentication alias: Set this if you wish to lookup the DataSource using its global JNDI name or using the java:comp/env/ name space and have set the authentication type of the resource reference to Application. Select the JAAS entry you had created. That is, Database user.
Container-managed authentication alias: Set this if you intend to lookup the DataSource using the java:comp/env/ name space and have set the authentication type of the resource reference to Container. Select the JAAS entry you had created. That is, Database user.
Use this data source in container managed persistence (CMP): Check on if you intend to use the DataSource from CMP EJBs.
Click on Next.
You need to set these properties:
databaseName: MALL in our case.
URL: jdbc:oracle:thin:@noble.webagesolutions.com:1521:MALL. In my case the server host name is noble.webagesolutions.com. The listener port number is 1521 (usually the default in most Oracle installations).
Click on Finish.
You have finished adding the DataSource. Save the server settings by clicking Control+S. Close the server configuration GUI.
Testing the DataSource
There is no out of the box way to test the DataSource. You can create a simple Servlet and add the following code:
public void doGet(HttpServletRequest req, HttpServletResponse resp)
javax.sql.DataSource ds = null;
java.sql.Connection con = null;
java.io.PrintWriter out = resp.getWriter();
resp.setContentType("text/html");
try {
out.println("Looking up DataSource<br>");
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
ds = (javax.sql.DataSource) ctx.lookup("jdbc/MyDataSource");
out.println("Getting connection<br>");
con = ds.getConnection();
con.close();
} catch (Exception e) {
e.printStackTrace(out);
out.println("Done<br>");
Feedback
Your e-mail:
Rate this article:
Very useful Somewhat useful Not bad Needs many corrections
Comments: -
How to have remote jdbc connection to timeten?
I think our admin have set up a timeten daemon , can I connect it remotely using JDBC connection? How the connection should be? Is it like
jdbc:timesten:192.168.1.2:dsn=my_dsn
??To create a JDBC connection, you need to specify a TimesTen connection URL. The format of a TimesTen connection URL is: </br></br>
jdbc:timesten:{direct | client}:dsn=DSNname;[DSNattributes;]
</br></br>
For example, to create a client connection to the demo data store, the URL looks similar to the following:
String URL = "jdbc:timesten:client:dsn=demoCS";
</br></br>
For more information, please refer to the section "Connecting to a TimesTen data store" in the Oracle TimesTen In-Memory Database Java Developer's and Reference Guide.
Maybe you are looking for
-
AS2 File name preseve - can we force the file name to be in Content-Type
Ref: http://www.b2bgurus.com/2007/11/as2-file-name-preserve-feature.html Our TP wants file name to be part of Content-Type of MIME rather than Content-Disposition. is this possible in Oracle B2B? Thanks, Kalyan
-
here's a screen shot: http://www.rainbowpuddle.com/images/twinsexample1.jpg As you see, it looks somewhat pixalated & solarized. Several others have expressed similar frustrations. I have used Reflective Black and Travel as themes. Video & H.264 Code
-
There were no results for un50eh5300 samsung blurry when i plug in my 2011 macpro
is there a way to use the background black and the letters white to view notes when displaying on the tv?
-
Increasing the speed of searching a string in a file
I have to search a String in a big ASCII-file and have to delete it. Now I wrote a program which opens the source file and a target file. I am reading each line from the source file, check it and write it into the target file. It is working fine but
-
Does Quicktime Streaming Server support Mac OS X 10.5.8?
Hi Sir, I would like to broadcast music from my laptop to my student about 5 client PC, I have only one MacBook Pro which current running Mac OS X 10.5.8, then I download quicktime streaming server 4.1.1 from Apple.com, after installed and run it. Se