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?
 
3)If I need upgrade 10g to 12c, what shall I do?

View Replies


ADVERTISEMENT

JDBC :: Unable To Establish Connection To Excel

Aug 21, 2014

I have failed with all possibilities that I know to make this program success. Getting error as :

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Program goes like this.

import java.sql.*;
public class ExcelConnection {
public static void main (String[] args){
try {
Connection conn = getConnection("TEST.xls");
Statement stmt = conn.createStatement();

[Code] ....

View Replies View Related

Establish Connection Using Connection Pool And Retrieve Username

Sep 1, 2014

I have created a JSP page, on click of a particular button, the control moves to the servlet "TestServlet".

This is the code under TestServlet:

import java.io.IOException;
import java.io.PrintWriter;
import java.security.Principal;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

[Code]...

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.

View Replies View Related

Java - Connection With Time Attendance Machine In Network

Apr 15, 2015

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.

View Replies View Related

How To Find Type Of Network Connection (wired Or Wireless) In Java

Jan 19, 2015

I want lo list all the devices connected to my network, I done like this

InetAddress i = InetAddress.getLocalHost();
byte[] ip1 = i.getAddress();
InetAddress address = InetAddress.getByAddress(ip1);
for (int b = 0; b <255;b++) {
ip1[3] = (byte)b;

[Code] ....

It prints all the connected devices, its k.. my doubt is, how to list the wired connections and wireless connections from them...

View Replies View Related

JDBC :: Open Connection String

Jun 25, 2015

What I have in my tnsnames.ora and verify it all works via sqlplus
 
CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1)
 
[Code] ....
 
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

View Replies View Related

JDBC :: Java Oracle Rac Connection URL Using Scan

Dec 30, 2014

I am trying to connect to an oracle rac using jdbc thin . when i use the scan as the host, like this

String url = "jdbc:oracle:thin:@//<scan>:port/servicename;

I get error 1153, connection refused

but when i use the ip of the rac instead of the scan

String url = "jdbc:oracle:thin:@//<ip>:port/servicename;

The connection is successful
 
Is the issue at the application level? or is the problem with the server ....

View Replies View Related

JDBC :: Change Oracle EBS Connection Pool

May 24, 2010

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?

View Replies View Related

JDBC :: Session Parameters And Connection Pools

May 1, 2015

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."
 
But is that the case in real life?

View Replies View Related

Web Services :: Share JDBC Datasource Connection Among All Servlets

Apr 20, 2015

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.

View Replies View Related

Enabling SSL In JDBC Connection To SYBASE For Thick Client App

Apr 19, 2015

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.

View Replies View Related

JDBC :: Connection Pool Keeping More Than Necessary Inactive Connections

Jun 19, 2015

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production0PL/SQL Release 12.1.0.2.0 - Production0CORE12.1.0.2.0Production0TNS for Linux: Version 12.1.0.2.0 - Production0NLSRTL Version 12.1.0.2.0 - Production0 

Using JavaSE-1.7
Using ucp.jar,ons.jar and OJDBC7.jar

I set up the datasource as follows :
 
pds = PoolDataSourceFactory.getPoolDataSource();
  pds.setConnectionFactoryClassName(factoryClassName);
  pds.setMaxPoolSize(maxPoolSize);                                                       maxPoolSize  10
  pds.setMinPoolSize(minPoolLimit);                                                        minPoolLimit 1

[Code] ....
 
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.

View Replies View Related

JDBC :: No Suitable Driver Found For Oracle Database Connection

Jul 10, 2015

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.

View Replies View Related

Networking :: URL Connection Error On HTTPs

Feb 16, 2013

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

[Code] .....

View Replies View Related

Error In Spring Using JDBC

Aug 7, 2014

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);
}

View Replies View Related

Set Background In Mouse Adapter

Sep 9, 2014

import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
 import java.awt.BorderLayout;
import java.awt.Color;

[Code] .....

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)

[Code] ....

View Replies View Related

Error While Making Connection With Remote Oracle Database

May 21, 2014

I am trying to make connection with oracle database but when i run java file it's raise an error

"classnotfoundexception oracle.jdbc.driver.oracledriver"
 
DriverManager.getConnection(
  "jdbc:oracle:thin:@erp:1521:ORCL", "apps",
  "apps");

View Replies View Related

Servlets :: Closing DB Connection Retrieved From Connection Pool

Jan 11, 2015

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?

View Replies View Related

JDBC :: How To Call Parameterized Stored Procedure In Jdbc

May 17, 2014

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

To call it in jdbc it goes like this

try{
String str = "{call patientreg(?)}";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbcdbc:GeneralHospit al");
cstmt = con.prepareCall(str);
cstmt.setInt(1, Integer.parseInt(t.getText()));

[code]....

after doing it this way it throwing an exception: Error:java.sql.SQLException: Parameter 1 is not an OUTPUT parameter.

View Replies View Related

Network Communication Using Sockets?

Dec 6, 2014

I have all of my code written, but it is not producing any output and i'm not sure why.

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;

[code]...

View Replies View Related

Streaming Music Over Network

Apr 16, 2015

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.

View Replies View Related

Bullets Not Firing Across Network Screen

Apr 10, 2014

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 {

[Code] ....

View Replies View Related

Sockets Can Be Used To Transfers File Over Network

May 7, 2014

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.

View Replies View Related

Swing/AWT/SWT :: Not Able To See Network Activity In JFrame

Jun 1, 2014

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.

Pasted the code below :

package com.ankit.analyser;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Window;
import javax.swing.JFrame;

[Code] .....

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.

View Replies View Related

Servlets :: Send Data Over Network Using Httpsession?

Jan 9, 2015

I am learning few concepts in servlets. And i came across this doubt. We used to send data over network using httpsession as below.

HttpSession session = request.getSession();
Object obj = new Object();
session.setAttribute("object", obj);

And get the data in JSP with below code

<%= session.getAttribute("object")%>

However I am not sure whether HTTPSession is serializable or not.

How HTTPSession works?

View Replies View Related

Sorting Without Using Disk - Network Or Virtual Memory

May 31, 2014

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.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved