In the class that actually uses it I create a method variable for the connection object.
Closing the connection as well as pds.getConnection().close();e
I am thinking that at the most I should have only one inactive connection showing up when I monitor the session. How do I configure the pool as to only show on inactive connection? I am running the test queries once every five minutes. But I am opening three connections each time.
I have installed and configured Oracle Business Intelligence Applications on top of one demo eBS instance as a source. Now I would like to change the OLTP to a different eBS instance but am not sure which steps to take. I don't know if I can add new EBS connection pool and a new DataWarehouse Connection Pool in the administration and have old ones preserved or I need to overwrite the old ones? Or (ideally) can I just change the OLTP and overwrite the old DWH?
Any document supporting the process of changing the eBS OLTP database without new installation of the OBIAPPS?
Now, I have got a comment saying I should get the database connection from connection pool. And one more issue is that I have used the function System.getProperty("user.name") to get the username which i have logged in. But this code will be run on Unix which will not support this function. Any function where I can get the windows username. There is a function getUserPrincipal(), but this function returns a NULL. How to resolve this.
I configured a connection pool in tomcat 7. For every database activity I get a connection from the pool. Do I have to close the connection like other regular connection after the database operation is done? If I close the connection will it have any effect on the connection pool?
I am using a static initialization block to register the driver and a static synchronized method to get a connection. The problem is I need to run 15 threads but always only two threads get the connection. I want to know if there is a default maximum number of concurrent connections a DriverManager can provide or is it my threading logic that may be faulty.
I am working on netbeans IDE , but I understand how the application know the parametres for the connections. I understand what is a Context , specifically i understand this code about the init method
We have a J2EE business web application that runs in WebLogic. We noticed in application log files errors messages that seems like "No resource available in db pool", it means all the connection objects (to Oracle database) are used. Then the application is unstable and unseable.
I think the maximum number of connections configured in Weblogic pool has been reached due to an increase of users and activity. But when the workload decreases the application is still out of service. It seems connections objects are not relased to the pool. What can be the explanation for this issue ? Normally it is managed by the container (EJB3 for the business tier).
Once the limit of the pool is reached it is necessary to restart the server to solve this kind of error ?
I am trying to get RJDBC to work so I can connect to Oracle from R doing some data analysis..
This connection string works for my local db which I have it running in my Virtual Box
con <- dbConnect(drv, "jdbc:oracle:thin:@//localhost:1521/orcl", "demo", "demo")
However, it does not work when I do it for the remote db that I really need to pull data from...
> con <- dbConnect(drv, "jdbc:oracle:thin:@//ymsdbppr-scan:1522/YMQCTPRD", "user_read", "user_read")
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], : java.sql.SQLException: Listener refused the connection with the following error: ORA-12514, TNS: listener does not currently know of service requested in connect descriptor
Suppose I issue a command such as "ALTER SESSION SET WORKAREA_SIZE_POLICY=MANUAL" inside a stored procedure called via JDBC and then release the connection back to the pool. When the connection is next reused by a completely independant Weblogic thread is there any chance that the non-default setting could be inherited by the new thread?
I realize that there is a conceptual difference between a process, a connection, and a session so theoretically the answer to my question should be "no."
I am new to java. I have recently learned JDBC connection pool in tomcat. To make code reuse I want to share the connection among all servlets without any conflict.
Here My code snippet:
public class GetConnection{ private DataSource ds; public Connection getConnection(){ try { InitialContext initialContext = new InitialContext(); Context context = (Context) initialContext.lookup("java:comp/env"); ds = (DataSource) context.lookup("connpool");
[Code] .....
Is this right way to do. Or I will get any problem due to concurrent threads.
Connection from Java app (installed on desktop) to sybase database (deployed on AIX machine) is going unencrypted.i.e Traffic can be read by some hacking tool and to fix I need to enable SSL/TLS.I am using JDBC to connect to sybase. I believe apart from setting the jconnect properties there are several other things which needs to be done.
Yesterday, I established a connection with oracle 12c, codes is here:
ods.setURL("jdbc:oracle:thin:c##mytest/myt@//myhost:1521/orcl");Connection conn=ods.getConnection(); where "c##mytest/myt" is username and password. It worked well.
But, today, "IO Error:The Network Adapter could not establish the connection" appeared when I tried to run my program again.
I changed //myhost into 127.0.0.1, it worked again.(Before I did this, I checked lsnrctl and regedit and firewall....., no difference)
Here is my question:
1) What happens between //myhost to 127.0.0.1, hostname cannot be use to JDBC? If yes, how?
Besides, I have some other questions:
2) How import a *.dmp file which exported from 10g into 12c?
I have small Java code, which execute every day and checks for data in database using Cronj Schedular and everything works fine, but recently I have observed that, it is failing due to
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@160.110.xx.xxx:1521/test
At the same time, when I run my test code to check Database connectivity that works fine without above exception. I'm unable to figure it out. Although, there was just slight code change, but that was nowhere related to Database or Database connection.
dbconf.java public class dbconf { private Connection connect; private String connstr; public Connection getConnection() throws SQLException { connstr = "jdbc:oracle:thin:@160.110.xx.xxx:1521/test";
[Code] ....
Application Log file
Wed Jul 01 09:25:17 IST 2015:------- Initializing ------------------- Wed Jul 01 09:25:17 IST 2015:------- Scheduling Jobs ---------------- Wed Jul 01 09:25:17 IST 2015:------- Job Started Running ---------------- Thu Jul 02 06:00:00 IST 2015 : Job Executed..!! Bschedularv2.2 java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@160.xxx.67.xxx:1521/test Sat Jul 04 06:00:00 IST 2015 : Job Executed..!! Bschedularv2.2 Sun Jul 05 06:00:00 IST 2015 : Job Executed..!! Bschedularv2.2 java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@160.xxx.67.xxx:1521/test
So, you can see, It failed on 3rd of July and 5th July as well. But, in between it ran fine.
This program asks the user for their starting balance, number of deposits, and number of withdrawals for a month
Now, if the number of withdrawals goes over 4, it has to include a service charge of 1.00 for every withdrawal that was more than 4 (This works fine so far)
The problem I am having is this:
The subclass part of this program is supposed to determine whether an account is below 25. If it is, it should make the account inactive, until the account is 25 or more. The subclass will have a method that will override the super's setWithdrawal mehtod to make sure that no withdrawals will be made until that balance is 25 or more.
Then the setDeposit method in the subclass will also override the super's setDeposit method and make sure that the account is not inactive before any deposits are made. If the account was determined to be inactive at that time and the deposits that were added make it jump to 25 or more, than the account should be changed to active and then be allowed to call the super's method to set the deposit.
So...the issue I am having is the subclass trying to determine whether the balance is under 25 before it calls the super's version of that method where it will allow the user to take money out and when making deposits where it will determine if the account was inactive first before make it active while the deposits raise to 25 or above.
Here is my super class:
// This is an abstract class that will be used for its child class BankAccount public abstract class BankAccount { private double balance; // To hold the account balance for the month private int numDeposit; // To hold the number of deposits for the month protected int numWithdrawal; // To hold the number of withdrawals for the month private double annualIR; // To hold the annual interest rate for the month protected double monthlyServCharge; // To hold any service charge for the month private double monthlyInterest;
calling a parameterized stored procedure in java jdbc from sql server.The stored procedure goes like this in sql
create proc patientreg @id int as begin select [patient_id],[Psurname], [pFirstname], [pMiddlename], [reg_date], [DOB], [Sex], [Phone_num], [Addr],[Email],[dbo].[fncomputeage](DOB) from [dbo].[Patient_registration] where [patient_id] = @id end please note dbo.fncompute(DOB) is a function
I'm using this methodology for Java connection between client and server, the server allows the user to stay connected while it is sending messages, but if you stay an average time of 5 minutes without send anything it is disconnected, I need to increase that time to about 30 minutes or disable this disconnection for inactivity.
Settings: Netbeans 8.0 Windows Seven 64 Bits Ultimante
I'm using this methodology for Java connection between client and server, I copied it from the internet, but the server allows the user to stay connected while it is sending messages, but if you stay an average time of 5 minutes without send anything it is disconnected, I need to increase that time to about 30 minutes or disable this disconnection for inactivity.
Settings: Netbeans 8.0 Windows Seven 64 Bits Ultimante
I have to implement an object pool that uses phantom references to collect objects abandoned by client threads. This is what I have. I'm really not sure about this implementation.
class ObjectPool<T extends CloneableObject<T>> { private Queue<T> pool; private List references = new ArrayList(); private ReferenceQueue rq = new ReferenceQueue(); private CloneableObject<T> prototype
Suppose i have a book class and bookArray class.in book class contains four fields name,id ,publisher and author. in bookArray class: book bookArray=new book[20]; i have to save those four fields in the array but after completed the array i should have re-size the array with contains the previous data. How?? I have pass those values from the main class..
I am trying to split a string into a String[] tokens array to declare variables for an object; however, I'm having an issue getting the string to tokenize correctly. Here's an example of the input:
a : 100 : John Smith : 20 Main St. a : 101 : Mary Jones : 32 Brook Rd.
Here is the basic code I have now, to properly sort each line of text, etc. (without the split() method):
Java Code:
while (scanner.hasNextLine()) { currentLine = scanner.nextLine(); lineScan = new Scanner(currentLine); if (currentLine.startsWith("/") || currentLine.trim().isEmpty()) continue;
[Code] ....
I was able to eliminate the comments and identifiers from the text by trimming the first two characters of the string. For the split, I tried String[] tempArray = currentLine.split("s+"); however, that also took the spaces out of the addresses and names...so the results looked like this:
100 John Smith 20 Main St.
As you can see, it splits via space regardless, including where I replaced all the :'s with spaces. Is there any way to do this?
Here are my conditions: You are developing a program to keep track of team standings in a league. When a game is played, the winning team (the team with the higher score) gets 2 points and the losing team gets no points. If there is a tie, both teams get 1 point. The order of the standings must be adjusted whenever the results of a game between two teams are reported. The following class records the results of one game.
public class GameResult { public String homeTeam() // name of home team { /* code not shown */ }
public String awayTeam() // name of away team
[Code] ....
The class TeamStandings stores information on the team standings. A partial declaration is shown below.
public class TeamStandings { TeamInfo[] standings; // maintained in decreasing order by points, // teams with equal points can be in any order public void recordGameResult(GameResult result)
[Code] ....
And here is the actual question:
Write the method adjust. The method adjust should increment the team points for the team found at the index position in standings by the amount given by the parameter points. In addition, the position of the team found at index in standings should be changed to maintain standings in decreasing order by points; teams for which points are equal can appear in any order.
And here is what I have so far:
private void adjust(int index, int points) { int Score[] = new int[standings.length] for ( int i=0; i <= standings.length; i++) { Score[i] = index, points; } }