JDBC connection for Unidata (6.1) database
Does any one know from the BI Publisher JDBC data source how to connect to a Unidata 6.1 database?
I have installed the UnidataDK on the BI Publisher machien, but not sure what's the setting for the class driver and connection string.
And also what else need to do for Oracle BIPublisher applicaton to know the Unidata driver path etc.
Appreciate anyone can give me a light.
Hi,
according to this document, Unidata JDBC driver class name is {noformat}com.ibm.u2.jdbc.UniJDBCDriver and URL format is jdbc:ibm-u2://<host>[:<port>]/<account>[[;name=value]...]{noformat}
Similar Messages
-
Problem with JDBC Connection for HDB hanadb 02
Hi folks,
Ok I have an instance based on the 7.4 SP5 HANA CAL solution.
But when I suspend and restart the R3 system doesn't start again.
I've followed the instructions in the user guide and can access the backend instance and see that for HDB GetProcessList everything is GREEN, running
while for A4H GetProcessList everything is GREY, stopped
When I try to start the A4H instance I get
Checking HDB database
Database is not available via R3trans
Database must be started first
The messages I found on SCN suggested this might be a license problem with the HANA database, so I tried to follow the install license instructions for the HANA database via the HANA studio, but when I try to open the HDB(SYSTEM) > Properties > Licence, I then get the messages
Error while reading the licence information from system HDB hanadb 02
Reason:
Cannot retrieve JDBC Connection for HDB hanadb 02
So what do I try now?
Any suggestions?
Rgds,
JocelynThanks Ivanka! That sorted it.
For the benefit of others...the error message was found in the server log files
/var/log/applianceagent.log
/var/log/appliancedeploy.log -
JDBC connection for SQL Server 2000
How to connect SQL Server 2000 from java?
If i can get any sites where i can get examples also fine.
Thanks in advance
Praveen.Developer's Daily Java Education
front page | java | perl | unix | DevDirectory
Front Page
Java
Education
Pure Java
Articles
JDBC 101: How to connect to an SQL database with JDBC
Introduction
If you're interested in connecting your Java applets and applications to standard SQL databases like Oracle, Informix, Sybase, and others, JDBC is your ticket to paradise. The combination of Java's JDBC and standard SQL makes a simple and powerful database solution. JDBC makes the simple things easy -- without making the complex tasks too difficult either.
In this first article in our series, we'll show you step-by-step how to establish a connection from your Java programs to an SQL database using JDBC. In the process we'll show you how to connect to two different databases -- Mini SQL (mSQL), and Interbase -- just so you can see how the code changes when you switch from one database to another.
Obtaining the JDBC driver
Before you start working with JDBC, you'll need a copy of the Java JDK. If you don't have it already, you can get the JDK for free at Sun's Java web site, or it will also be included with many IDE's that you can purchase, such as JBuilder or Visual Cafe.
Once you have the JDK, the next thing you need to do is to get the correct JDBC driver for your database. In most cases the JDBC driver will be provided by your database vendor. For instance, if you purchase the Interbase database, the driver will be provided with the software, or you can obtain the most recent version at http://www.interbase.com/.
(An exception to this rule is Mini SQL, or mSQL. Because it's a very low-cost database, the JDBC driver has actually been developed by a separate group of people, led by George Reese at imaginary.com. You can download the mSQL JDBC driver from the imaginary.com web site.)
Once you have the correct JDBC driver for your database, install it according to the instructions that came with it. Installation instructions will vary somewhat for each vendor.
Establishing a connection is a two-step process
Once you have the correct JDBC driver installed, establishing a connection from your Java programs to your SQL database is pretty easy.
Regardless of whether you're trying to connect to Oracle, Sybase, Informix, mSQL, or Interbase (or any other JDBC data source), establishing a connection to an SQL database with Java JDBC is a simple two-step process:
Load the JDBC driver.
Establish the connection.
We'll show you two examples just so you can see how easy it is, and how little the code changes when you migrate from one database server to another.
A Mini SQL Example
Listing 1 provides the full source code required to establish a connection to a mSQL database on a server named "www.myserver.com".
// Establish a connection to a mSQL database using JDBC.
import java.sql.*;
class JdbcTest1 {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("com.imaginary.sql.msql.MsqlDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:msql://www.myserver.com:1114/contact_mgr";
Connection conn = DriverManager.getConnection(url,"user1","password");
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
Listing 1: This source code example shows the two steps required to establish a connection to a Mini SQL (mSQL) database using JDBC.
An Interbase Example
Listing 2 provides the full source code required to establish a connection to an Interbase database. In this example, we're connecting to a local Interbase server (i.e., the server is running on the same PC that we're running the Java code on).
// Establish a connection to an Interbase database using JDBC.
import java.sql.*;
class JdbcTest1 {
public static void main (String[] args) {
try {
// Step 1: Load the JDBC driver.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:odbc:contact_mgr";
Connection conn = DriverManager.getConnection(url,"user1","password");
} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
Listing 2: This source code example shows the two steps required to establish a connection to an Interbase database using JDBC.
What's the difference?
The difference between the two source code listings is very small, so we highlighted them in a dark blue color. The only difference between connecting to the two databases is:
The name of the JDBC driver.
The URL used to connect to the database.
Everything else in the two source code listings -- except for the comment at the top -- is identical. Here's a slightly more detailed discussion of the two differences:
1. The JDBC Driver
The name of the JDBC driver will be supplied to you by your database vendor. As you can see in the class.forName() statements, these names will vary. In the first case we're using the mSQL-JDBC driver. In the second case we're using the JDBC-ODBC Bridge driver supplied with the Interbase server.
2. The URL
The syntax of the DriverManager.getConnection() method is:
DriverManager.getConnection(String url, String username, String password);
The username and password are the normal names you use to log into your database. The URL you use will again vary with the database you use. In both examples shown, we're establishing a connection to a database named contact_mgr. (We'll use this database for all of our examples in this series of JDBC articles.)
If you stick with standard SQL commands, it can be very easy to switch from one database server to another. In fact, I've heard from several developers who are using mSQL to prototype their software (because it's so inexpensive), and then switching to another commercial vendor when it's time to take their product "live".
Conclusion
Establishing a connection to an SQL database with Java JDBC is a simple, two-step process. The process is nearly identical for all SQL databases, and the only real differences are (a) the driver name, and (b) the URL used to connect to the database. Your database vendor will provide this information in their documentation.
Resources mentioned in this article
Here are a few links to resources we mentioned in this article:
Interbase
The Mini SQL (mSQL) database
The mSQL-JDBC driver at imaginary.com
[an error occurred while processing this directive]
-
Hello Experts,
I'm having some trouble getting a JDBC connection to work correctly and I am in need of some advice.
Background:
I have setup a test Portal 7.00 SP14 with an Oracle 10.2.0.2.0 database on a Windows 2003 X64 server. The Portal system was up and running and connecting to a WAS6.20 systems. We do not have BI or XI in our landscape.
I needed to connect to an Oracle 10.2.0.3.0 database from visual composer to read some data from tables to do a proof of concept. From what I understand this connection will be a JDBC connection. I have setup a new system using the JDBC template, assisnged an alias, and entered the connection URL . I was unable to connect.
I read that I need to add the driver using Visual Composer. I did so with the following instructions:
Install JDBC Driver
Start the Visual Administrator
Logon at WebAS
Open: Server, Services, JDBC Connector, Drivers
Choose Create New Driver or DataSource on the toolbar
Specify an arbitrary name for your driver entry such as OracleDriver and click OK
Now search for the Oracle JDBC Driver JAR file on your local harddisk.
I restarted the Java instance with SMICM after completing this task Java will not start. Is there anyway to roll back that change to get Java back up and running?
Also is there a better way to go about making this oracle connection?
Best Regards,
Edited by: Troy Loseke on Feb 20, 2008 8:30 AMHi,
although [this guide|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/92d80512-0a01-0010-32a3-cd3735bd9275] is for Visual Composer I find it very helpful in setting up JDBC connections to databases. There is a very deltailed section about setting up a system to a MS SQL Server and the relevant data if you want to connect to Oracle:
4.2 BI JDBC Connector to Oracle
Located at:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
Driver: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:<drivertype>:@<database>
jdbc:oracle:thin:@myhost:1521:orcl
Hope this helps,
Holger. -
NW04s JDBC Connection for MSSQL not working
In portal JDBC settings are:
Connection properties
URL = jdbc:microsoft:sqlserver://192.168.0.101:1433;DatabaseName=Northwind
Driver = com.microsoft.jdbc.sqlserver.SqlServerDriver
User Management
User mapping type = admin,user
I assigned a user to Administrator under User Administration
Visual Administrator settings are:
DriverName = com.microsoft.jdbc.sqlserver.SqlServerDriver
URL = jdbc:microsoft:sqlserver://192.168.0.101:1433;DatabaseName=Northwind
UserName = empty
Password = empty
Result
Connection test fails in portal. The settings appear ok.
The only thing I can think of is that user specified in portal user mapping is not setup properly on SQLServer.
Also:
When I run link:
http://localhost:53000/TestJDBC_Web/TestJDBCPage.jsp
my jdbc service MSSQL_JDBC does not appear. MSSQL_JDBC was cloned from SDK_JDBC and the libray for drivers was added
I am running MSSQL 2000 SP4 but using JDBC drivers for SP3 as I didn't find any for SP4 and assumed they would work for SP4
What am I missing?Raynald,
I think I am having a similar problem.
I also cloned the connection names in Vis. Administrator to the SDK_name.
Indeed it now appears in the test servlet, and I can succesfully execute SQL statements from there.
So the connector seems ok.
But I have still problems with the Connection Test in the Portal.
I am trying to make BI JDBC system to be able to use my database from the Visual Composer.
I am using these properties:
CodeLink = com.sap.portal.systems.bi.SAP_BI_JDBC
ConnectionFactoryClass = SDK_TESTDB
ConnectionUrl = jdbc:jtds:sqlserver://sapserver:1433;databaseName=TestDb
(this url is the same as in Vis. Administrator)
Driver Class Name = net.sourceforge.jtds.jdbc.Driver
Fixed Catalog = empty
Fixed Schema = empty
System Type = SAP_BI_JDBC
User Mapping = admin, user
I am logged in as Administrator, so I added the login credentials at the User Mapping page of the Administrator user.
When I use Connection Test function from the portal I get the following messages:
Retrieval of default alias successful
Connection failed. Make sure user mapping is set correctly and all connection properties are correct.
What can I do to solve this problem? -
BI JDBC Connection For MSSQL 2005
Hi All,
I am trying to establish an BI JDBC Connection with MSSQL 2005 Server. I follow the steps exactly mentioned in the guide but i was not successfull. I doubt the problem could be with the adapters and again downloaded a JAR file for MSSQL 2005 from microsoft website and proceeded with steps. But no luck this time also.
How do i make a successfull connection. Below is the result of a test page
==================================================
Details:
com.sap.ip.bi.sdk.exception.BIConnectionFailedException: Cannot open the connection at com.sap.ip.bi.sdk.dac.connector.jdbc.JdbcConnectionFactory.getConnectionEx(JdbcConnectionFactory.java:238) at com.sap.ip.bi.sdk.trialarea.connector.servlet.model.JDBCModel.getConnection(JDBCModel.java:797) at com.sap.ip.bi.sdk.trialarea.connector.servlet.model.JDBCModel.getTables(JDBCModel.java:132) at com.sap.ip.bi.sdk.trialarea.connector.servlet.controller.Control2.doPost(Control2.java:23) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: com.sap.ip.bi.sdk.exception.BIResourceException: Cannot open the connection at com.sap.ip.bi.sdk.dac.connector.jdbc.JdbcManagedConnection.(JdbcManagedConnection.java:123) at com.sap.ip.bi.sdk.dac.connector.jdbc.JdbcManagedConnectionFactory.createManagedConnection(JdbcManagedConnectionFactory.java:119) at com.sap.engine.services.connector.jca.ConnectionHashSet.match(ConnectionHashSet.java:320) at com.sap.engine.services.connector.jca.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189) at com.sap.ip.bi.sdk.dac.connector.jdbc.JdbcConnectionFactory.getConnectionEx(JdbcConnectionFactory.java:233) ... 19 more Caused by: com.sap.ip.bi.sdk.exception.BIResourceException: Cannot connect to JDBC data source at com.sap.ip.bi.sdk.dac.connector.jdbc.impl.Connection.connectDB(Connection.java:394) at com.sap.ip.bi.sdk.dac.connector.jdbc.impl.Connection.connect(Connection.java:106) at com.sap.ip.bi.sdk.dac.connector.jdbc.JdbcManagedConnection.(JdbcManagedConnection.java:118) ... 23 more Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]End of stream was detected on a read. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at com.sap.ip.bi.sdk.dac.connector.jdbc.impl.Connection.connectDB(Connection.java:376) ... 25 more
====================================================
regards,
AnandHi Anand,
did you check the WIKI:
<a href="https://wiki.sdn.sap.com/wiki/display/VC/JDBCConnectionSetup">https://wiki.sdn.sap.com/wiki/display/VC/JDBCConnectionSetup</a>
Best Regards,
Marcel -
Dymanic JDBC connection for mulitple application..
Hi,
I am developing an application which using dynamic JDBC connection when user login it's provide the username, password and JDBC datasource and it's work fine in my main application.
But when I drop my other application Jar file into that main application and the other application call from the main application it uses the default JDBC datasource which was there in the other application but not the data source which provided in the main application.
I am using Jdeveloper 11.1.2.3.0. version.
Thanks in advance.Hi,
You might want to try something akin to the Visitor pattern
i.e.
record.update(Connection conn) {
PreparedStatement stmt = conn.prepareStatement("Update...");
Where a controlling class maintains the connection and you
invoke the function with the connection parameter, just make sure you are not
doing this concurrently.
hope this helps -
Problem in - JDBC Connection for MS-Access in JSP
Hi,
I am using Three tier Architecture. that is MS-Access as a Database, JAva Web Server as a server and HTML as a frontend.
I always getting error during the execution of JSP code.
Coding in JSP:
<%@ page import="java.sql.*"%>
<%
java.sql.Connection con;
java.sql.PreparedStatement pstmt;
java.sql.ResultSet rst;
String sDBQ= application.getRealPath("dem.mdb");
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+sDBQ);
pstmt = con.prepareStatement("select * from employee");
rst = pstmt.executeQuery();
if (rst.next())
String s1=rst.getString("EmployeeId");
String s2=rst.getString("EmployeeName");
out.println(s1);
out.println(s2);
catch(Exception e)
out.println("Error "+e);
%>
I'm getting this error
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
Please anyone rectify ithi
[Microsoft][ODBC Driver Manager] Data source name(dsn)
con=DriverManager.getConnection("jdbc:odbc:dsn);
first you open the control panel --open ODBCdatasource--user dsn--click add--and select MS-Access--click finish--one window is come --type "dsn"--then click ok --ok .then try it it will come.(before you doing program you can set this) -
Jdbc connectivity for mssql 2008 in ipv6
trying to connect to mssql server 2008 in a machine enabled for ipv6 using the following code :
Connection c = null; String url = "jdbc:sqlserver://;servername=fe80::21a:4bff:fecf:dfe5%4;port=1433;DatabaseName=mssql;selectMethod=cursor;"; String userid = "xxx"; String password = "xxx"; Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); try { c = DriverManager.getConnection(url, userid, password); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }
but getting the error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.NoRouteToHostException: No route to host: connect at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at ConnectDB.main(ConnectDB.java:84)
what is the problem.can any one please suggest me how to connect to mssql using ipv6..
Thanks in advance...
Edited by: 789764353 on Sep 7, 2009 4:20 AMI guess you must have seen this. But, just in case.
[Creating a Valid Connection String Using TCP/IP|http://msdn.microsoft.com/en-us/library/ms191260.aspx]
Also,
SQL Server and SQL Server Native Client fully support both Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). When Windows is configured with IPv6 SQL Server, components automatically recognize the existence of IPv6. No special SQL Server configuration is necessary.[Connecting Using IPv6|http://msdn.microsoft.com/en-us/library/ms345359.aspx] -
JDBC Connectivity for SQL Server 2005 Windows Authentication Mode
Hi Everyone,
In my Scenario we are using SQL Server 2005 with Mixed Mode Authentication. Now we are planning to move only with Windows Authentication Mode.
We have configured DB with Window authentication mode & user id have been configured in PI channels however we are getting error. We checked microsoft site, which says Windows Authentication mode DB can not be connected using JDBC drivers.
http://support.microsoft.com/kb/313100
In this above link see Basic Connectivity Troubleshooting Section.
Please let me know if someone confirued JDBC Channel Successfuly with Windows Authentication Mode.
Thanks In Advance
Regards,
Bharathi.I think this issue is related to the way that Vista, Windows 7 and Windows 2008 / 2008 R2 treat users who are logged on to the system with an account that is a member of the local administrators group when SQL is running locally.
If your SQL setup has left you with BUILTIN\Administrators being a member of the sysadmin server role and you start up SQL Management Studio you'd expect to be mapped to the sysadmin role if your user account is in the local administrators group, however
these OS disable this ability and when you try to connect to the database engine SQL server doesn't know you are a member of the local administrators group.
To get round this, close all your open SQL management studio windows and then start a new window by right clicking the icon in the start menu and chosing to run as administrator. This time when you try to connect to the SQL database engine, windows doesn't
"hide" the fact that you are an administrator. If you need to do this a lot you can go to the compatibility tab on the properties of the shortcut and set it to always run as administrator.
Alternatively you can install the admin tools remotely and you don't get this effect.
Tim -
"Cannot Get JDBC Connection for external changed actions"
Hi,
When I start Planning 9.3 server using tomcat, keep getting this error. I checked the configuration and is okay. Stopped and Started shared services and same result.
Does anybody has had this message and got around..I have Hyperion System 9 9.3.0.1 installed on a windows 2003 server. Sql Server 2003.
Any ideas are highly welcomed!!
Thanks in Advance :)Hi Ankit Jain
yes it's the second option,
exactly the error occurs when I click the icon to select the repository of work - work_dev
then this exception is generated
=
I select for the field
Drivers List -
the value >> Oracle JDBC Driver
and then is placed in the Driver Name field
value>> oracle.jdbc.OracleDriver
and after I put a URL
jdbc: oracle: thin: @ (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = sss.rrr3.ttttj.ggg.br) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RRR3) ))
It should say
that
This is occurring on a machine, but others the same configuration is working
I think it's something of the environment on this machine,
but no longer know what to test
grateful for your attention. -
JDBC - Connecting Multiple Databases
Hi JDBC's
I would like to know if it is possible to retrive a data from different tables and from different databases using a single query, which mean can I retrive data from multiple tables multiple databases in a single JDBC connection?
If not, How do I implement it?
Any Ideas or please point me to any related solution if you have.
Thanks.Although theoretically possible in fact a single JDBC connection cannot work with several databases. To implement this feature somebody has to write another aggregating JDBC driver which parse SQL statement and work with other databases in background. I like this idea, but currently there is no such driver available.
Scriptella ETL (http://scriptella.javaforge.com) offers an interesting solutions for cross-database operations. See example on how -to copy a table from oracle to hsqldb: http://snippets.dzone.com/posts/show/3511
If you want to join 2 tables from different databases and copy the result to a third database use the following code:
<query connection-id="db1">
SELECT * FROM Table1
<query connection-id="db2">
SELECT * FROM Table2 WHERE Table2_ID=?Table1_ID
<script connection-id="db3">
INSERT INTO Table3 VALUES (?rownum, ?Table1_Field, ?Table2_Field);
</script>
</query>
</query>
Message was edited by:
ejboy -
JDBC for Unidata 5.1?
Does anyone know if there is a jdbc driver for Unidata 5.1?
I've have the same question regarding Unidata 5.2. Did you ever get a response or any sort of resolution? I checked the Informix site (informix.com) and one of their documents said that version 6.0 (due out in Q3 or Q4 of 2002) was going to be JDBC compliant. Obviously, that doesn't help us much, but I'm still searching for a work-around.
-
Monitoring total number of JDBC connections
We have our application deployed in the Oracle 10g Application server, it uses Toplink 10g for the Persistence and OR mapping and the Oracle 9i database for data storage, the database connection pool is built and maintained by Toplink.
We observed that on the administration screen for each container, there are 2 parameters, number of active database connections and the total number of JDBC connections.
We did some load testing for the application and observed the following behaviour on the container.
1. When the number of parallel users are 10, behaviour seems to be normal, the active database connections are less than 20(used by the connection pool built by Toplink) and the total number of JDBC connections is the same as the number of database connections.
2. When the number of parallel users is increased to 50, we see that the active database connections is still less than 20, but the total number of JDBC connections just blowed up to 4000+ in less than 2 minutes and still growing. We have no valid explanation for this behaviour as the active sessions is still less than 20. Also we see no obnormal behaviour in our application log files.
The questions i have are
1. What could be the reason for the above abnormal behaviour?
2. How this parameter "Total number of JDBC connections" for a container is actually measured?
3. DOes this parameter gets affected by how we run the database i.e. in Dedicated server mode or Despactcher mode?
Many thanks for any information on this topic..Perhaps your connection inactivity timeout is slightly too low, so that your connections are being closed and reopened at almost the same frequency. Try increasing the timeout.
Good Luck,
Chris -
Deadlock detected (JNDI vs JDBC connection)
Hello to all..
this is my parallel thread as a subquestion about Struts in JDeveloper and Datasources..
I'am developing a struts application for a large assicuration company...
In my struts application I use JNDI to connect to my database (I'am developing in Jdeveloper 10 but i like to migrate do Jdeveloper 11)
the xml file is this:
This is the Error (in Jdeveloper 10) when two or three users acess a database procedure via Oc4J (struts) using JNDI!
ORA-00060: deadlock detected while waiting for resource
if I change the connection to use a normal JDBC connection ie: Connection con = DriverManager.getConnection(....);
all works fine...
What is the difference? why in the first example i get deadlock and why in second example all is ok?
(my datasource definition from Jdeveloper 10 is )
<?xml version = '1.0' encoding = 'windows-1250'?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
<data-sources>
<data-source
name="jdev-connection-RAZ"
class="com.evermind.sql.DriverManagerDataSource"
location="jdbc/RAZCoreDS"
xa-location="jdbc/xa/RAZXADS"
ejb-location="jdbc/RAZDS"
pooled-location="jdbc/RAZPooledDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="xxxx"
password="xxxx"
url="jdbc:oracle:thin:@xxxxx:1521:xxxx" inactivity-timeout="30"/>
</data-sources>
and the struts "Action" code is like this:
InitialContext ic = new InitialContext();
Datasource ds = (Datasource)ic.lookup("jdbc/RAZDS");
Connection con = ds.getConnection()
Statement st = con.createStatement();
st.execute(...);
st.execute(...);
st.execute(...);
st.execute(...);
st.execute(...);
st.execute(...);
con.commit;
con.close();If I run my example (2-3 users at the same time) which call many pl/sql functions I get the error:
ORA-00060: deadlock detected while waiting for resource
If I change the JNDI connection to normal JDBC connection for example
Connection con = DriverManager.getConnection(....);all works fine!
what is the difference? why I get locking when using JNDI connection?
Message was edited by:
user618280Well, JDBC resources should be freed in general, even if the documentation claims that a specific driver could do this. Ie. st.close(), conn.close() each wrapped by a try-catch-Block. Apache Commons DbUtils has methods helping you to do this without re-inventing the wheel (org.apache.commons.dbutils.DbUtils).
Using DriverManager is not Java EE conformant and you'll lose Connection Pooling, Transaction Management, etc.
--olaf
Maybe you are looking for
-
XDCAM HD workflow with Adobe Premiere Pro CC and Macbook Pro
Hi folks, I have an assignment for a TV production to secure and convert the data (mxf files XDCAM HD 422 1080i 50 / 50 Mbit/sec with 8 audio channels) from Sony XDCAM camcorders (PDW-700) for postproduction. The producer wants me to convert the mxf
-
[IDEA] Too large images ...
Hi Guys, I see often post edits by moderators where the post contains full size image's, i saw today already 4 edits. So, is it an idea to write a plugin in PHP or JS to check their topic post before submitting for too large images or resolutions pas
-
CAlert::InformationAlert
Hi all, I m new to Indesign Programming. (InDesign CS3 on Win XP) I m trying to test "BasicMenu" (a sample file in SDK) I found some codes: /* DoAlwaysOn void BscMnuActionComponent::DoAlwaysOn() CAlert::InformationAlert(kBscMnuAlwaysOnStringKey); /*
-
Dear All: We tested fully in development sever the configuration for Output taxes everything worked well. But when FI & SD configuration was transferred to production sever we got an error while maintaining condition for output taxes
-
I can't install Adobe Acrobat Distiller 6, needed by Adobe Pagemaker 7 to export pagemaker documents as pdfs, because I have a later version of Distiller, Adobe Acrobat Distiller IX. When I try to install I get the message "Setup has detected that yo