JDBC :: IO Error - Network Adapter Could Not Establish Connection
Jan 24, 2015
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?
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'm working in project, my theme is to develop an application management system for fingerprint and RFID card attendance machine in java programming language.
My problem i didn't find documentation in java for connecting with this device.
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
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?
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.
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 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.
I have noticed an error, that makes sometimes troubles, when downloading jars from https addresses, when there are many jars to download..
Best example is by opening Javas on Java version checker. [URL] ....
I get also following log...
network: Connecting https://www.java.com/jsp_utils/jreverification.jar with proxy=DIRECT network: Connecting http://www.java.com:443/ with proxy=DIRECT network: Connecting https://www.java.com/jsp_utils/jreverification.jar with cookie "JSESSIONID=22ABBA2BE9B5789629C276AC35BDF969; s_cc=true;
Even if the address is https, java try to access via http protocol on port 443, and that leads sometimes to problems..
I have noticed this, when I have used URLConnection(HttpURLConnection) for my self, as soon Java sends http link on https address, the jar gets sometimes not loaded, and i get error about missing class that get called..
On http addres it is not so bad, since same protocol is used, but evidently, that is evil for https..
As you see, that happens already when loading Jar by Applet Starter and at all, it happens each time on any URLConnection
############################### Java Plug-in 10.13.2.20 Using JRE version 1.7.0_13-b20 Java HotSpot(TM) Client VM User home directory = X:Usersadmin ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect
public class StudentJDBCTemplate implements StudentDao
above class giving error as
The type StudentJDBCTemplate must implement the inherited abstract method
StudentDao.listStudents()
Interface is as below
import java.util.List; import javax.sql.DataSource; public interface StudentDao { public void setDataSource(DataSource ds); public void Create(String Name,Integer age); public void getStudent(Integer id); public List<Student>listStudents(); public void delete(Integer id); public void update(Integer id,Integer age); }
Isn't changing my backgrounds in my MouseAdapter I keep getting these errors:
at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
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?
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 want to make a service like Spotify, where I can stream music that I have stored on my computer (in this case server) to my laptop or phone.
* What would be a suitable format for this? * How would I actually stream it? I want to stream, not download and then play, I want to play the music while downloading.
I have a program thats ran over a network and is multi-player. However whenever I fire any bullets they do not fire on the other clients screen. Here's the code
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import javax.swing.*; import java.util.*; public class TankWar {
This question has confused me because "Errors" are capitalized and I'm not sure what they mean.
To me this question is false. Sockets can be used to transfers file over a network.
I can't see why this wouldn't work. The code looks fine to me.
I don't think this is true unless you're using the mouseEntered() or mouseExited() method. But again, I'm not sure.
I think this is true, I don't know what else could have listeners.
They're only worth a few marks each so the answer is only suppose to be a line or two. They are all true or false questions that require an explanation.
I am trying to develop an application which will be showing a TimeSeries graph(related library JFreeChart) displaying network activity related to a particular network interface embedded in a JFrame.I have created a JPopUpMenu which is having containing a list of JMenuItems showing network interfaces as their String values.Menu is popping up correctly
Further I am selecting a JMenuItem related to a particular network interface to show network activity in TimeSeries graph.On selecting a JMenuItem I can see that graph is moving on constantly but not able to see any network activity.
Further I can see that packetArrived method of PacketListener is not being overridden by class PacketHandler as I am not able to see data packets on console and static list in main class is also empty.
Suppose you are given a computer with 1GB RAM. The disk of this computer holds a 10GB file containing random numbers. Propose a technique for sorting the file without using the disk or network or virtual memory. Outline your approach, propose an algorithm, and implement the algorithm. What is the algorithmic complexity of your algorithm.