If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > jdbc AS400

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-03, 12:00
lullo lullo is offline
Registered User
 
Join Date: Nov 2003
Posts: 20
jdbc AS400

--------------------------------------------------------------------------------
i have a connection problem (jdbc/As400), this is my code:


import java.io.*;
import java.sql.*;
import com.ibm.as400.access.*; // package tollbox for Java
//import com.ibm.db2.jdbc.app.*;
import gui.*;

public class ConnectionDb{

static Connection AScon;
static String hostname = new String("x.x.x.x"); // IP address per acccesso Remoto

// Se utente non č specificato verrā presentata automaticamente una finestra con la richiesta utente
static String user = new String("XXX"); // nome utente AS400 di default
static String pwrd = new String("XXX"); // password utente AS400

static AS400 ASname = new AS400(hostname);

/**
* Costruttore per accesso Remoto (richiamato per default)
*/
public static void main(String [] args){

// Apre connessione con AS400 se necessario
try {
System.out.println("2");
if ((AScon == null) || (AScon.isClosed())) { // se la connection č close >> open connessione
DriverManager.registerDriver(new AS400JDBCDriver()); // registro il driver
System.out.println("3");
AScon = DriverManager.getConnection("jdbc:as400://" + ASname, user, pwrd); // accesso remoto
}
new Application();
//AScon.close();
}catch (SQLException ex1) {
System.out.println ("SQLException : " + ex1.getMessage());
}
}
}

end this the error msg:

SQLException : The application requester cannot establish the connection.(AS400 (system name)


could you help me, i very tired!!!
byebye
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On