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


ADVERTISEMENT

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 :: 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

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

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 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

Securing Client Server HTTPs Connection

Mar 1, 2014

I have a https connection from Client to Server and a malware in client. The malware modifies the message and compromises its integrity. I am using a proxy to check the Integrity of the message after the malware has changed the message and before sending it over the internet to the server.

Now, How can I check the Integrity of the message (Sure that it has not been modified by any Man in the Middle) for the second half of my communication channel(Which is from Client to the Server over the internet).

I see few conventional approaches of CRC or Checksum will work. But I am looking for some non traditional or upcoming approaches.

Ideally SSL Data shouldn't be able to be decrypted by any MIM. But my assumption is that any Protocol is subjected to attack and compromised in real world and few recent studies are proving that https is breakable. Thus, I am trying to perform a What if analysis? On the client side, lets say malware is not more powerful than just modifies the transaction amount and destination account number in a typical online Baking transaction.

View Replies View Related

Java Client To WCF Service - Secured Connection

Oct 14, 2014

I have created a sample java web service client using Apache Axis. It works well with basicHTTPbinding (without security and Basic authentication).I am not able to make a secured communication. How to make it work in a secured way using NTLM or any other security.

View Replies View Related

Enterprise JavaBeans :: Connection Of Android Client With Java EE Server

Mar 9, 2013

I am using EJB (Stateless) without any web service. I simply need to send a String from Client to Server

I can connect any Java SE Client with this EJB. But how I can connect an Android Client with this EJB (i.e. Using EJBRemote Interface) directly? I am using :

Glassfish Application Server
Netbeans IDE

View Replies View Related

Web Services :: Getting Connection Time Out - JSON Rest Client For POST Request

Mar 23, 2015

I want to write one REST client program for POST request ,request and response is in JSON Format.

public String getAck() {
HttpURLConnection httpConnection = null;
URL url=null;
try {
url = new URL("http://test:8080/ils/main");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();

[Code]....

Line OutputStream os = httpConnection.getOutputStream();

I am getting connection time out problem

View Replies View Related

Enterprise JavaBeans :: How To Start A Socket Client Connection With EJB3 Timer Bean

May 28, 2013

I have some embedded systems (with web server) putting their states, sensor values into an XML file.

<sensor1>
<temp>21.4</temp>
<unit>°C</unit>
</sensor1>

Now I played a little with EJB3. I want to start a timer bean in a 10second interval which retrieves the IP of registered devices from a databases, opens client sockets with a Thread Pool and retrieves the XML file over HTTP GET of each device listed in the db.

Is it possbile with EJB3? how to start thread based background services like that within EJB3 timer bean?

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

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

Enabling UAC In Jar

May 28, 2014

I have created a jar file and while running i need to elevate the admin privilage on executing that jar.In vc++ there is an option to elevate and run as administrator.How can i achieve the same through java code.

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

JSF :: 2.2 - Enabling CSRF Protection In App Causes Error

Sep 6, 2014

I enable csrf protection in faces-config as follows:

<protected-views>
<url-pattern>/protected.xhtml</url-pattern>
</protected-views>

When I try to open the page in browser I get following error:

javax.faces.application.ProtectedViewException
at com.sun.faces.lifecycle.RestoreViewPhase.maybeTakeProtectedViewAction(RestoreViewPhase.java:310)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:231)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

[Code] .....

View Replies View Related

Enabling Java In Applications On Hard Drive

Oct 18, 2014

I just installed java on my computer because i was getting messages that it was no longer there. And I figured out how to solve my problems on my browsers.  but i don't see how to enable java in my applications on the hard drive.  in particular, i want to use the database in open office but don't see how to enable it.

View Replies View Related

JSF :: Enabling And Disabling ComboBox / TextBox Based On Actions

Apr 24, 2014

This is my modalPanel code:

<rich:modalPanel id="createManagedObject" moveable="false" autosized="true" width="500" rendered="true" domElementAttachment="form">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Create Managed Object"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:outputLink onclick="#{rich:component('createManagedObject')}.hide(); return false;">

[Code] ....

As shown in the above code:

I have following components in ModalPanel:

1) ComboBox
2) Instance
3) Save and Cancel

I wanted some validation here :

For example:

- The Instance Text box and SAVE button should be disabled. When the pop up appears.
- The Instance Text BOX gets enabled only when any selection happenes in COMBO Box
- The SAVE button gets enabled only when COMBO BOX and INSTANCE TEXT BOX is filled.
- Let the CANCEL button be enabled always.

View Replies View Related

Comparing Sample Client With Real Time Client - Transport Error 404

Jan 23, 2015

I have tried each and every thing in all the other answers. Like setting chunked to false, changing parameters, changing http1.1 -1.0. I am just writing a sample client to compare it with my real time client. Following is the code of client:

package com.webservicemart.ws;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import com.webservicemart.ws.USZipStub.ValidateZip;
public class UsZipClient {
public static void main(String[] args) {

[Code] ....

And Following is the error :

[INFO] Unable to sendViaPost to url[http://www.webservicemart.com/uszip.asmx]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:310)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)

[Code] ....

I have tried with other geoIP service and weather forecast too. I get the same error.

View Replies View Related

How To Give URL Connection To Code

May 11, 2014

how to give URL Connection to this?

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
import javax.swing.event.*;
public class WebBrowser

[code]....

View Replies View Related

Connection To A Database In Its Own Class

Jan 15, 2015

I was wondering if I could take the following code and somehow put the connection to database in it's own class without the "public static void main(String[] args)" method. That way I could call it anytime i want to open a connection to the database.

Java Code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Sample {
public static void main(String[] args) throws ClassNotFoundException

[Code] ....

View Replies View Related

EJB / EE :: GenericJDBCException - Could Not Open Connection

Oct 3, 2014

I am new to EJB; I am writing EJB (3.1) program in JBoss 7.1 - I am using MySQL DB with JPA. While executing the program, I am facing the Generic JDBCException: Could not open connection. It is happening only for certain tables in the database; but NOT for all tables. My code is able to access few of the tables in the same database. Here is my full stack trace: -

Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

[code]....

View Replies View Related







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