Basic client Server stuff

Say i have two classes class A and class B. class B is a server that is run on computer (comp1) and then i run class A a client on both Comp2 and Comp3. How do I ,
Comunicate with the server (class B) on comp1?
Share variables and other information between comp2 and comp3 by means of classB on comp1
and how to I properly close the connection after these goals are accomplished.
If someone could post a good tutorial covering these things or simply explain it themselves it would be greatly appreciated, Thanks for taking the time to look at this post.
-Dizzixx

Google is very good at answering these types of questions.
http://www.google.com/search?q=java+client+server+tutorial

Similar Messages

  • Basic Client-Server query

    I'm in the early stages of writing a client-server program. I've got the client and the server communicating (I think). I send text from the client to the server. I then want the server side BufferedReader in to be read into a variable. I've tried doing it using String inputLine = in.readLine() but it keeps throwing an IOException. I can't work out why.
    try {
                PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
             System.out.println("The printwriter and bufferedreader have been set up.");
                String inputLine, outputLine;
                inputLine = in.readLine();
                System.out.println(inputLine);
            } catch (IOException e) {
                System.out.println(e);
            }The serverSocket and socket have been set up properly as far as I can tell. It's just the above portion of code that seems to be causing a problem. My knowledge of Java is fairly basic at the moment, so any help would be greatly appreciated.

    I agree that jdbc is probably the simplest approach here and it is probably the best introduction to java/database interaction. If you put some forethought into the design then it will also take some time out of transitioning to RMI should you decide to go that route. Is there a reason jdbc won't work for your application?
    Oracle's JDBC download:
    [http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html]
    Oracle JDBC FAQ:
    [http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm]
    You can find lots of tutorials on connecting, querying, etc. via google as well.
    RMI may help keep the client smaller and also gives some flexibility but if these (remote) methods are only going to be used for this application then once again jdbc may be the best choice. If there is a possibility that other applications may use them in the future then it might be a good choice.
    [http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html]

  • Help Needed With Basic Client/Server App

    I was wondering if anyone can help with a simple blackjack client/server application i've been writting (basically its a moddified chat application). The problem i'm having seems to lie within the connection management i've written.
    What i'm trying to get is that only 4 players can connect at one time and that each player takes a turn (which i've implemented using threads) to play their hand (as you would if you were playing it for real). The problem is that it will allow the players to connect, but oddly enough, it will not allow a new transaction to be created (i.e. allow a player to take their turn) until 2 players have connected.
    Even when it does create the transaction, after taking input from the client once, the server seems to stop doing anything without any error message of any kind.
    Its really annoyed me now, so you guys are my last hope!
    The code can be found in full here:
    Client Application: http://stuweb3.cmp.uea.ac.uk/~y0241725/WinEchoClient.java
    Server Application: http://stuweb3.cmp.uea.ac.uk/~y0241725/ThreadServer.java
    Card Class: http://stuweb3.cmp.uea.ac.uk/~y0241725/Card.java
    Deck Class: http://stuweb3.cmp.uea.ac.uk/~y0241725/Deck.java
    Please feel free to play around with this code as much as you feel necessary!

    (one last bump back up the forum before i give up on this completely)

  • Client server stuff - but simple -Duke $10 offered

    Hi folks
    I want to count # of times a method in server is called by the client.
    In the server code I put a count and in each method implementation I increment count.
    I am getting following errors for the count ..
    CalculatorImpl.java:44: cannot resolve symbol
    symbol : variable count
    location: class CalculatorImpl
    count++;
    ^
    PLEASE HELP ME>>>>>
    ---------------here's the code -----------
    import java.net.MalformedURLException;
    import java.rmi.Naming;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class CalculatorImpl
    extends UnicastRemoteObject
    implements Calculator
    public static void main (String[] args)
         int count;
    try {
    new CalculatorImpl ().go ();
    } catch (Exception e) {
    System.err.println (e);
    private void go ()
    throws MalformedURLException, RemoteException
    Naming.rebind ("rmi://127.0.0.1/CalculatorImpl", this);
    public CalculatorImpl ()
    throws RemoteException
    public int add (int x, int y)
    throws RemoteException
         count++;
    return x + y;
    public int sub (int x, int y)
    throws RemoteException
         count++;
    return x - y;
    public int mul (int x, int y)
    throws RemoteException
         count++;
    return x * y;
    public int div (int x, int y)
    throws RemoteException
         count++;
    return x / y;
    public int report ()
    throws RemoteException
    return count;
    public void reset ()
    throws RemoteException
    count = 0;

    Kuno
    Can you let me know what is your opinion on following...
    I have a simple client Server code running (Loop back IP is used in Name.bind) in 2 windows, third window rmiregistry is running to lookup for the remote object.
    Say another second client come in while the first client is in the middle of the code...
    1) What will happen ?
    2) Will both clients get their own objects seperately ?
    3) How do they track the use of a method in the remote object ?
    Thanks a bunch...

  • Client/Server hang up?

    I'm writing a basic client server program. I created an ArrayList to hold all the sockets of a connection so each client could, hopefully, eventually interact.
    Right now my client is a text field with a text area under it. A user types a command up top and then hits enter and sends that along to the server. However when i send in the message it seems to hang up and never sends back a reply. But what's really odd about it, is that if i close my server window and there by shutting it down the client then outputs exactly what i expected it to if it was working right. So im curious why there's this hangup in my code?
    Server:
    import java.awt.BorderLayout;
    import java.awt.Font;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.ArrayList;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class Server extends JFrame{
              private JTextArea jta = new JTextArea();
              private static ArrayList<Socket> clients = new ArrayList<Socket>();
              public Server(){
                   getContentPane().setLayout(new BorderLayout());
                   getContentPane().add(new JScrollPane(jta), BorderLayout.CENTER);
                   jta.setFont( new Font( "Times", Font.BOLD, 20));
                   setSize(500, 300);
                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   setVisible(true);
                   try{
                        setTitle("Server: " + InetAddress.getLocalHost().getHostName());
                        int clientNo = 1;
                        ServerSocket serverSocket = new ServerSocket(0);
                        jta.append("Port: " + serverSocket.getLocalPort() + "\n");
                        while(true){
                             Socket socket = serverSocket.accept();
                             InetAddress inetAddress = socket.getInetAddress();
                             clients.add(socket);
                             World thread = new World(socket);
                             jta.append("Connected with client :" + clientNo + "\n");
                             thread.start();
                             clientNo++;
                   }catch(IOException ex){
                        System.err.println(ex);
              public static void main(String[] args){
                   new Server();
              public static ArrayList getClients(){
                   return clients;
         }World:
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.util.ArrayList;
    import java.util.Scanner;
    public class World extends Thread {
         private Socket mySocket;
         private int myPort;
         private InetAddress myInetAddress;
         private String myHostName;
         private ArrayList<Socket> theClients;
         public World(Socket newSocket) {
              mySocket = newSocket;
              myPort = mySocket.getPort();
              myInetAddress = mySocket.getInetAddress();
              myHostName = myInetAddress.getHostName();
         public void run() {
              String test;
              Scanner input = null;
              PrintWriter output = null;
              try {
                   String fileName;
                   input = new Scanner(mySocket.getInputStream());
                   output = new PrintWriter(mySocket.getOutputStream(), true);
              }catch(IOException e){
              output.println("Please Enter Command");
              while((test = input.nextLine()) != null){
                   if(test.contains("get clients") ){
                        theClients = Server.getClients();
                        for(int i = 0; i < theClients.size(); i++){
                             output.println(theClients.get(i).getInetAddress().getHostName());
                        output.flush();
                   }else{
                        output.println("not sure");
                        output.flush();
    }Client:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.Scanner;
    import javax.swing.*;
    public class Client extends JFrame implements ActionListener{
         private JTextField jtf;
         private JTextArea jta = new JTextArea();
         private PrintWriter output;
         private Scanner input;
         public Client(String host, int port){
              JPanel p1 = new JPanel();
              p1.setLayout(new BorderLayout());
              p1.add(jtf = new JTextField(10), BorderLayout.CENTER);
              jtf.setHorizontalAlignment(JTextField.RIGHT);
              jtf.setFont(new Font("Times", Font.BOLD, 20));
              jta.setFont(new Font("Times", Font.BOLD, 20));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(p1, BorderLayout.NORTH);
              getContentPane().add(new JScrollPane(jta), BorderLayout.CENTER);
              jtf.addActionListener(this);
              setSize(500,300);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setVisible(true);
              try{
                   setTitle("Client: " + InetAddress.getLocalHost().getHostName());
                   Socket socket = new Socket(host, port);
                   input = new Scanner(socket.getInputStream());
                   output = new PrintWriter(socket.getOutputStream(), true);
                   jta.append(input.nextLine() + "\n");
              }catch(IOException ex){
                   jta.append(ex.toString() + "\n");
         public void actionPerformed(ActionEvent e){
              String nextLine;
              String findFile = jtf.getText().trim();
              ((JTextField)(e.getSource())).setEditable(false);
              if ( e.getSource() instanceof JTextField){
                        jta.append("Getting file: \"" + findFile + "\" \n");
                        output.println(findFile);
                        output.flush();
                        while(input.hasNext()){
                             nextLine = input.nextLine();
                             jta.append(nextLine + "\n");
         public static void main(String[] args){
              int portSend;
              if (args.length != 2){
                   System.out.println("not Enough arguments");
                   System.exit(-1);
              portSend = Integer.parseInt(args[1]);
              new Client(args[0], portSend);
    }

    Don't run networking code in the constructor. Start a separate thread for the accept loop.

  • Fault tolerance client /server

    hi
    i use a very basic client/server socket program
    very similar to sun:
    http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    many client can connect to the server...
    i would like to add a fault tolerance...
    a client try to connect a few time... that don't work, the client try to the second server...
    does a need to do something similar to
    public class KKMultiServer {
        public static void main(String[] args) throws IOException {
            ServerSocket serverSocket1 = null;
            ServerSocket serverSocket1 = null;
            boolean listening = true;
            try {
                serverSocket = new ServerSocket(4444);
                serverSocket = new ServerSocket(4445);
            } catch (IOException e) {
                System.err.println("Could not listen on port.");
                System.exit(-1);
            while (listening){
             new KKMultiServerThread(serverSocket1.accept()).start();
                new KKMultiServerThread(serverSocket2.accept()).start();
            serverSocket1.close();
            serverSocket2.close();
    }thanks

    i need your help to finis my code
    what i want to do is to create to start 2 tread of server in my class main server....
    and each class server start a thread for each connection...
    each time a client do a request, i count it
    theses method is in server class
    import java.net.*;
    import java.io.*;
    public class ServerMain {
        public static void main(String[] args) throws IOException {
             //will call 2 time server here         
             Server server1 = new Server();
             Server server2 = new Server();
             server1(4444).start();
             server2(4445).start();
    import java.net.*;
    import java.io.*;
    public class Server extends Thread{
        private static int nbRequete=0;
        public synchronized int ajouterRequete(){
            return nbRequete++;
        public synchronized int getRequete(){
            return nbRequete;
        public int port=0;
        public Server(int port) {
            super("Server");
            this.port = port;
        public void run() {
            ServerSocket serverSocket = null;
            Socket s=null;
            boolean listening = true;
           // Server server = new Server();
           // int port;
            try {
                 //will put a port variable
                serverSocket = new ServerSocket(port);
                s=serverSocket.accept();
            } catch (IOException e) {
                System.err.println("Could not listen on port.");
                System.exit(-1);
            System.out.println("server run, wait connecting....");
            while (listening)
                new ServerThread(s).start();
            //serverSocket.close();
    import java.net.*;
    import java.io.*;
    public class ServerThread extends Thread {
        private Socket socket = null;
        public ServerThread(Socket socket) {
            super("ServerThread");
            this.socket = socket;
        public void run() {
            try {
                System.out.println("connexion successfull");
                System.out.println("Attente de l'entree.....");
                PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
                BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                                socket.getInputStream()));
                String inputLine, outputLine;
                while ((inputLine = in.readLine()) != null) {
                    System.out.println("Server: " + inputLine);
                    inputLine = inputLine.toUpperCase();
                    out.println(inputLine);
                    if (inputLine.equals("Bye."))
                        break;
                out.close();
                in.close();
                socket.close();
            } catch (IOException e) {
                e.printStackTrace();
    }the server need to have different port
    i'm a little bit confuse
    i don't know how to finish this project
    :confused:
    i have some error i don't understand
    ServerMain.java:11: cannot find symbol
    symbol  : constructor Server()
    location: class Server
            Server server1 = new Server();
                             ^
    ServerMain.java:12: cannot find symbol
    symbol  : constructor Server()
    location: class Server
            Server server2 = new Server();
                             ^
    ServerMain.java:13: cannot find symbol
    symbol  : method server1(int)
    location: class ServerMain
            server1(4444).start();
            ^
    ServerMain.java:14: cannot find symbol
    symbol  : method server2(int)
    location: class ServerMain
            server2(4445).start();
            ^
    4 errors

  • Client server application using CORBA

    Hi
    I have a basic client server application running using CORBA/idl where the client starts up and the server says hello back to the client. I have figured out the basics but would like some help with these small problems.
    When I start the client, the server says hello. Thats OK. Now I want the client to start a simple java app (called c:\test.java - it works) that I created before. How?
    The next bit is when I close down the app "test" that I start, I want the server to realise that its closing and simply say goodbye on the client. How?
    If anybody can help me, I'd appreciate it.
    Thanks for your time,
    Shaun

    hi,
    to my knowledge, you will have to define a method in idl file and in your client, which server invocates(saying good bye etc) before shutting down..
    ls.

  • Client Server using Internet [ask]

    I have a client server project who connect between LAN connection and now I want to upgrade it into internet connection. I have search several programs who has similar architecture but none is suitable. Could anybody help me out how to build basic client server which connect using internet connection?
    I have attach my previous program below, I really appreciated if anyone may modify it so be able connect trough internet.
    Solved!
    Go to Solution.
    Attachments:
    Client.vi ‏262 KB
    Server.vi ‏164 KB

    Hi,
    with your program, you seem to have the full control over your house ;-). Why it shouldn't work over internet as it is? You have TCP open, TCP close...in Internet, you simply have to use other IP-adresses as the local ones. So can you specify your question? Or is it a problem with your LAN-infrastructure, that you have to configure your router to have access from outside?
    I don't see why it shouldn't work over Inet...
    christian
    THINK G!! ;-)
    Using LabView 2010 and 2011 on Mac and Win
    Programming in Microsoft Visual C++ (Win), XCode (Mac)

  • Capturing SQLNET client-server traffic

    Pardon the somewhat newbie-like question ...
    I am trying to build a API test stub where I need to be able to capture the requests and responses between third-party two-tier applications then replay the traffic. The replay is easy. The capture, though, is giving me trouble.
    For HTTP traffic, it is easy. I just change Internet Explore's HTTP port address to point to a fake proxy which records the requests the sends the requests onto the real web server.
    Is there an equivalent to this in the SQLNET world? I am hoping that a proxy already exists to do this.
    If not, is there a way to turn on a full trace for a specific client? I would need to capture all connections coming out of the client and no other client's connections.

    This could provoke quite a discussion.
    "If your client are on slow links you may, for example query 10,000 rows of data. "
    Generally, forms shouldn't be pulling back tens of thousands of rows from the database. Your user is unlikely to page through that much, so either you want a summary (which is best calculated on the database server and the summary results dragged across the network) or you are paging through records in the tens, not tens of thousands. (Look at the 'Number of recods buffered' property in your base table blocks. Bet it's one or two digits, not five!)
    "The information that is transmitted to the client is basically screen draw information - and this will be alot less than the 10,000 rows you were querying before. "
    As above. In client/server you shouldn't have been bringing stuff from the database down to the client that wasn't going to be on the screen anyway, especially if you had a slow network.
    Depending on how your application is written, it could well peform a lot worse on the web than in client server. Rather than having the client do a fair share of the work, it's now got to keep talking to the application server to get anything done.
    For example, because navigation triggers don't allow the use of restricted built-ins, rather than putting code in a 'post-text-item/when-validate-item' trigger on the relevant item, it gets put in a form level 'when-new-item-instance' trigger. It's a bit untidy in client/server but workable. Put it on the web, and every time the user tabs between fields, the form has to go off to the application server to fire the when-new-item-intance trigger to tell it what to do next.
    Another 'speed-bump' is if you have any synchronize bits (eg in a post-query trigger, or as part of a "I'm 10% complete" information messages in long running loops). These will also generate network traffic between the app server and form.
    While web server does have advantages, I wouldn't be selling it on it's performance improvements.

  • Client/Server network traffic.

    I don't know if here is the right forum to ask it, but let's go on.
    Nowadays we a system on Forms 4.5/windows/Oracle 8.0
    We have some clients machines linked to the server by a Frame-Relay link and we use Windows 2000 Terminal Server to reduce the network traffic.
    Well, we are gonna update to Forms 6i/Oracle 8i.
    I would like to know if Forms Server can be a good option to Windows 2000 Terminal Server.
    If I haven't been clear with my question I'll can do it again. I'm new on Forms 6i and I've just installed it to test (It hasn't been working yet....)
    Thanks in advance
    Ronaldo.

    This could provoke quite a discussion.
    "If your client are on slow links you may, for example query 10,000 rows of data. "
    Generally, forms shouldn't be pulling back tens of thousands of rows from the database. Your user is unlikely to page through that much, so either you want a summary (which is best calculated on the database server and the summary results dragged across the network) or you are paging through records in the tens, not tens of thousands. (Look at the 'Number of recods buffered' property in your base table blocks. Bet it's one or two digits, not five!)
    "The information that is transmitted to the client is basically screen draw information - and this will be alot less than the 10,000 rows you were querying before. "
    As above. In client/server you shouldn't have been bringing stuff from the database down to the client that wasn't going to be on the screen anyway, especially if you had a slow network.
    Depending on how your application is written, it could well peform a lot worse on the web than in client server. Rather than having the client do a fair share of the work, it's now got to keep talking to the application server to get anything done.
    For example, because navigation triggers don't allow the use of restricted built-ins, rather than putting code in a 'post-text-item/when-validate-item' trigger on the relevant item, it gets put in a form level 'when-new-item-instance' trigger. It's a bit untidy in client/server but workable. Put it on the web, and every time the user tabs between fields, the form has to go off to the application server to fire the when-new-item-intance trigger to tell it what to do next.
    Another 'speed-bump' is if you have any synchronize bits (eg in a post-query trigger, or as part of a "I'm 10% complete" information messages in long running loops). These will also generate network traffic between the app server and form.
    While web server does have advantages, I wouldn't be selling it on it's performance improvements.

  • Simplest possible client-server for file sending...

    Hi im trying to create a simple client-server application using sockets.
    All i want the server to do i listen for the client to send him a file.
    Then maby later i'll implement some other stuff like resuming and stuff like that.
    And so the client application is only supposed to send a specified file to the server...
    However, all the examples and tutorials i've found on the net are either to complex or only dealing with textfiles. I dont need the client to specify what type of file it is just send it in byteform or whatever so that the server can write it to disk.
    I get a migraine from all the different types of input/output streams and i dont know which one to use and so on.
    If anyone has a good tutorial or example code somewere (seems to me this should be considred very basic stuff) please enligthen me :-)
    all help will be appreciated
    thanx
    /Eric

    Yep, O rielly - Networking for Java, not sure exact title, or any basic JAva network book. They start out with a simple app and over chapters add to it, you could stop where you want.....

  • Client == server - problems with callbacks

    Hi everyone!
    I'm having trouble establishing bidirectional communication between a client and a server (code samples are below).
    Both classes (client & server) extend UnicastRemoteObject and implement Interfaces that are extending Remote. Now the client looks up the server and tries to register itself at the server by calling a method like this:
    remote_server.setClient(this);
    as long as I execute both programs in the same LAN this method-call works fine, but when client and server connect through internet I'm getting the following exception:
    ---------------------- Exception ------------------------>
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectException: Connection refused to host: 192.168.0.3; nested exception is:
         java.net.ConnectException: Connection timed out
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
    <---------------------- Exception ------------------------
    maybe helpful:
    - 192.168.0.3 is the client's LAN-IP
    - I am directly connected to the internet via ADSL-modem (no router)
    I searched the forums for several hours now, I read through the following tutorial,
    http://developer.java.sun.com/developer/onlineTraining/rmi/exercises/RMICallback/index.html
    but still I didn't find a solution.
    I already spent a lot of time developing this and I start to get desperate, so I hope someone of you out there can help me!
    pilord
    ==================== Codesamples =======================>
    public class ServerImpl extends UnicastRemoteObject implements Server {
    Client client;
    public ServerImpl() {
    LocateRegistry.getRegistry(1096).rebind("test",this);
    /* specified in Remote-Interface: Server*/
    public void setClient(Client client) {
    this.client = client;
    public class ClientImpl extends UnicastRemoteObject implements Client {
    public ClientImpl() {
    Server s = Naming.lookup("rmi://***.***.***.***:1096/test");
    s.setClient(this); // HERE is the trouble.
    <==================== Codesamples =======================

    Don't feel lost, crumb. Http tunnelling is not as complex as it seems. I just started using RMI at my new job here and in a couple of weeks I've already picked up on alot of what I needed to know. (I just posted a question myself on the same topic.) Basically what you have to do is set up a web server for RMI to talk to at the server side. It will work if the webserver is listening on port 80 with the rmiservlet.ServletHandler registered to respond to any path request of cgi-bin/java-rmi.cgi. In other words "cgi-bin/java-rmi.cgi" should be the servlet-mapping of the ServletHandler. The servlet merly acts as a proxy on behalf of the RMI client and fowards the request to the desired port on the server. If you know how to set up a servlet as the default web app then it is really a breeze. On the client side you only need to set the http.proxyHost and http.proxyPort system properties to the appropriate values for your proxy server. (I mistyped these property names in my prior post use what I have here as I just read it out of the RMI book.) Do a search on HTTP tunnelling and you should turn up dozens of hits. I have the source to the servlet if you need it. I've already modified it for my own purposes though it should still work for you. If you forego http tunnelling then you'll have to do a complete app rewrite to use another protocol because RMI just doesn't work through firewalls without it. Alternatively you can get down and dirty with some low level sockets coding (this is what I'm thinking I'll end up doing eventually) to get it working without standard RMI/HTTP but that's way more complex. Unfortunately it looks like your callback code will need to be rewritten unless you either go commercial or do the socket stuff. (There does seem to be a shareware product called rmi doves that would help you here.) I'll be happy to assits you in any way as you need help.
    Cliff

  • Client-server database application...

    Hi there!
    I'm about to write a database-application and I wonder if the following approach is to prefer or not:
    I want to use a MySQL-database and there shall be about eight client-applications which all shall be able to use it. I think of solving the above with RMI (I want to create/deploy a server wich will contain all the different SQL-queries on the same site as where I install the MySQL-database ). From the clients I just, with RMI, invoce the methods on the server which contains the different queries I want to use. In other words all the database-functionality is located on the server somewhat like stored procedures. To make it work each client must be assigned a thread of its own on the server...is this right?
    The advantages of the above which I can think of is: I just need to stuff one J/Connector driver in the JRE (on the server). Another is that I can use the nameservice of RMI... are there others?
    Is the above a good / usual or even bad approach?
    Is it more usual or even better to just provide the database-functionality (SQL-queries) in the clients and provide every client with the J/Connector driver?
    Thanks in advance!

    You noted that there will be "eight client-applications" - does that refer to eight users or eight programs using the database? This is important in determining your course of action.
    If you're talking about a small number of concurrent users (you have to define small), then you'll probably better off trying to do all the data/business logic in the app. If you're talking about a large number of concurrent users (again, your definition), your client/server paradigm might be better.
    To complicate things, unless you're doing this as a learning-on-your-own project (e.g. not getting paid for it), this is where you might want to evaluate using J2EE technoligies for your server-side implementation. Writing your own server is not a trivial task (been there, done that - pre-J2EE, of course): there's a lot of things you have to figure out how to handle. Well, that's true of even using J2EE, but there's some portion of what your server would need to do already taken care of in an application server.

  • OLE Alternatives in Forms 6i Client Server

    I'm fishing for some advice and maybe some examples of how to get around an OLE issue that's adversely affecting an upgrade project.
    We're currently migrating a Forms 4.5 application to 6i. This application displays MS Word documents (OLE Container) that are stored in the database and uses OLE to open manipulate, and save the documents back to the database. We've come across some serious problems with OLE and 6i that don't look like they'll be fixed any time soon (bug #2615804 in particular).
    Since OLE (ActiveX) is not supported a web delivered configuration, we're looking at an alternative to interacting and storing Word documents using a client/server configuration. This will have the added bonus of making the move to web delivery once we decide to go down that path.
    Has anyone out there had any good experience with overcoming this OLE problem? It seems like every pre-Forms 9i book out there has touted OLE as a way of interacting with Office tools and now OLE has become a roadblock.
    I've had a look at the JACOB example, but that doesn't really help if you're not deploying via the web.

    With the beans you've looking at visual stuff : like the look and feel project
    With the importer it's more like leveraging java functionality : in my case I've just implemented a call to a webservice on an application server. There is nothing visual here and it's just called via a straight bit of PL/SQL that call my java classes ( however, in that case I could also use UTL_HTTP directly to make the call and thus not bother with java importer - but the database wouldn't allow UTL_HTTP calls :( )
    For both of these you'd need to tell forms where to find the JAR file in it's java environment - but you won't have that in c/s
    Another way is to load up java code into the database and process it within the database and hide it completely from Forms. I've done this sort of thing loading Apache-FOP into Oracle and creating PDF files in the database (as BLOBS) from XML/XSL also in the database as XMLTYPES.
    At least that's my view on how it fits together ... maybe others know more :)
    Steve

  • Incorrect decryption operation in client-server

    Hi all, sorry for my English, I don't know where is the problem and I don't see examples for internet.
    I have a cliente-server aplication, where client read a file, encrypt it and send it to server. The server doesn't decrypt de text correcty. For example if the file contents:
    "Hola, probando el cifrado y descifrado.", the server shows "Hola, probando eifrado."
    I think that the problem is in the form for send and receive the cipher text.
    I put the code for client:
    import java.net.*;
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    class ClientAES {
      public static void main(String argv[]) {
        try {
          System.out.print("Introduce the key : ");
          String cadena = Teclado.readString();
          SecureRandom rand = new SecureRandom(cadena.getBytes());
          System.out.println("Generating key...");
          KeyGenerator keyGen = KeyGenerator.getInstance("AES");
          keyGen.init(rand);
          SecretKey desKey = keyGen.generateKey();
          System.out.println("Key generated");
          Socket s=new Socket(argv[0],4096);
          FileInputStream fis = new FileInputStream(argv[1]);
          byte[] b=new byte[fis.available()];
          System.out.println("Bytes that can be read of file: "+fis.available());
          fis.read(b);
          System.out.println(Text send: "+new String(b));
          Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
          cipher.init(cipher.ENCRYPT_MODE,desKey);
          CipherOutputStream cos = new CipherOutputStream(s.getOutputStream(), cipher);
          cos.write(b, 0, b.length);
          fis.close();
          cos.close();
          s.close();
        } catch (Exception e) { e.printStackTrace(); }
    }and server:
    import java.net.*;
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    class ServerAES {
      public static void main(String argv[]) {
        try {
          System.out.print("Introduce the key: ");
          String cadena = Teclado.readString();
          SecureRandom rand = new SecureRandom(cadena.getBytes());
          System.out.println("Generating key...");
          KeyGenerator keyGen = KeyGenerator.getInstance("AES");
          keyGen.init(rand);
          SecretKey desKey = keyGen.generateKey();
          System.out.println("Key generated");
          ServerSocket servidor=new ServerSocket(4096);
          System.out.println("Waiting a client...");
          Socket s=servidor.accept();
          System.out.println("Recieve a client connection");
          Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
          cipher.init(cipher.DECRYPT_MODE,desKey);
          CipherInputStream cis = new CipherInputStream(s.getInputStream(), cipher);
          byte[] in = new byte[cipher.getBlockSize()];
          int length;   
          System.out.println(cipher.getBlockSize());
           length = cis.read(in,  0, in.length);
          System.out.println(new String(in)+new String(cipher.doFinal()));
          cis.close();
          s.close();
        } catch (Exception e) { e.printStackTrace(); }
    }

    eeeh, if I understand your code correctly, then you are creating keys in each process. That means, you'll have two different keys. But you are using AES, which is a symmetric encryption algorithm. Hence you'll need to have the same key on both sides. Otherwise you'll not decrypting the stuff you where encrypting before.
    stephan

Maybe you are looking for

  • AppleWorks 6.0 Files Listed As Unix Executable Files. Unable To Open.

    A client of mine backed up a number of AppleWorks 5 & 6 files last week on a PowerMac w/ OS X 10.3. I reformatted the HD, upgraded the OS to 10.4 and attempted to reinstall AppleWorks 6.0. It would not allow installation. So, I installed OS 9 Classic

  • Apple 20" display problem

    I have an  20-inch apple display connected to a late 2006 mac pro (3ghz dual core). Recently a horizontal line (black mostly, but sometimes with some color pixels) began appering inside the web browser window (Safari or Chrome)...not always immediate

  • AE CS6 updater crashing on Mountain Lion

    Hi Have been using AE CS6 11.0.2.11 on Mountain Lion. Yesterday I got a message telling me that an update was available, but when trying to install it message was that it had failed and I should try again later. So I just tried it again today and it

  • Changing of Means of Transport for deployment order

    Hi All, Is it possible to manually/ programatically change the means of transport of a deployment order ? for example once deployment has run, it has created a deployment order with means of transport, lets say, 0001 ( Truck). Now i want to change th

  • Different information about patchset

    Hello, customer told me that on the database is 11.1.0.7 patchset so I downloaded CPUJUL2010 (patch 9654987). It is only for 11.1.0.7 on linux x64 but it failed. I found that it is propably due the different patchset so i have check in in database an