TCP/IP Server Socket using Java Proxy (Sender) ?

Hi,
I have requirement to listen certain port for third party POS system using TCP/IP Socket. Since there is no standard SAP TCP/IP Socket Adapter. I am planning to develop using Sender Java Proxy.
Please advise whether this approach is workable ? or is there any related blog / forum discuss about Socket Server.
This blog is only for socket client /people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
Thank You and Best Regards
Fernand

When you want to have minimal effort, you can create a standalone Java program which listens on a port and transforms the incoming tcp/ip stream to an HTTP message, which you can send to SAP PI.
With more effort you can create an TCP/IP adapter by your own, according to JCA architecture.
A sender Java proxy does not have any runnable code itself, so the problem to create a listened is not solved.

Similar Messages

  • Is is possible to create Socket using Java Stored Procedures/Function(Ora)?

    Hello Friends,
    Is is possible to create Socket using Java Stored Procedures/Function in Oracle?
    OR
    How I can send a message from oracle to Java Desktop Application which is working like server program?
    Please Guide !!

    J3Ganesh wrote:
    Hello Friends,
    Is is possible to create Socket using Java Stored Procedures/Function in Oracle?No, Oracle was very careful to take that feature out of the JDK provided in Oracle 10/11, but you can buy that feature back for, if I remember correctly, about 5000 dollars. (I actually raised a service request on this and then told my rep what I thought about the answer I received--some thing along the line of money grubbing so and so....)
    How I can send a message from oracle to Java Desktop Application which is working like server program?You can make a table and poll it from time to time from the Java side and write and commit what ever you want to the table. I do not know any way to send a signal from Oracle DB an external Java application--Java or PL/SQL stored procedure.

  • Design a client-server system using java

    hello every body,
    I'm trying to design a client-server system using java,
    it work but the Qustion is:
    How can I send more than one mssg on the client side, and How can I recive more than one mssg on the client side?
    I tryed this:
    At client_
          System.out.println("Enter your Name:");
          BufferedReader stdIn1 = new BufferedReader(new InputStreamReader(System.in));
          String userName;
          userName=stdIn1.readLine();
          //sending message to the server
           out.println(userName);
          System.out.println("Enter your password:");
          BufferedReader stdIn2 = new BufferedReader(new InputStreamReader(System.in));
          String Passw;
          Passw=stdIn2.readLine();
          //sending message to the server
          out.println(Passw);
         BufferedReader stdIn3 = new BufferedReader(new InputStreamReader(System.in));
         String userInput;
         userInput=stdIn3.readLine();
         //sending message to the server
         out.println(userInput);
       //receiving message from the server and printing
       String revc;  
       revc=in.readLine();
       System.out.println(revc);
    At server_
        //reading from a client
          inputLine = in.readLine();
          outputLine = "Reply From Server :HelloClient ";
          //sending message to a client
          out.println(outputLine+"------"+ inputLine);
    i hope this is the right place for my question, and hope to get help
    thanks.

    Is there a reason you create a new InputStreamReader and a new BufferedReader every time you prompt for user input?
    lass_987 wrote:
    How can I send more than one mssg on the client sideInvokeout.println()more than once.
    How can I recive more than one mssg on the client side?Invokein.readLine()again.

  • PI7.11 Can I use Java proxy on  Advanced Adapter Engine ??

    To:PI Specialists
    Now I m planning to use Java Proxy on PI7.11.
    and I want to know Java Proxy can act on AAE as local processing.
    I wonder that Java Proxy do not connect  to adapter engine but  to integration engine.
    If it connect to integration engine I ll not to use Java Proxy on AAE...
    Please teach me about Java proxy will do on AAE....
    Naoki Kurihara

    Now I find out we can't use Java Proxy on AAE....
    Please check this pdf page 12.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70066f78-7794-2c10-2e8c-cb967cef407b?quicklink=index&overridelayout=true

  • Help - how to create java proxy (sender) in NWDS 7.1

    Hi,
    I am trying to develop a java proxy as sender to send message from WAS to PI.
    I am using NWDS 7.1. Let me explain what I have done so far,
    1. Received proxy classes from PI
    2. Created a EJB Project, imported the proxy classes into EJB project
    3. created a EJB bean, local interface in the EJB project and exposed as webservice
    4. added the ejb to an ear
    5. added reference to the following jar files (external library)
    tcaiiproxy_rt_api.jar
    com.sap.aii.af.sdk.jar
    com.sap.aii.utilxi.server.jar
    com.sap.aii.utilxi.core.jar
    com.sap.aii.proxy.svc_api.jar
    6. able to build and deploy the application
    7. able to open the webservice in wsnavigator
    Error encountered:
    "Server Exception: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/sap/aii/proxy/xiruntime/core/AbstractType "
    Questions:
    1. Which method I should execute / call among all the proxy classes from local bean class to send message to PI?
    2. Is it mandatory to add refernces to the application.xml, ejb-jar.xml and other xmls ?
    3. How can I test / monitor the message being sent to PI interface?
    Thanks and best regards,
    Arun prabhu S

    plz cross chk the references under application-j2eeengine.xml and ejb-jar.xml
    http://wiki.sdn.sap.com/wiki/display/Java/JavaProxyChangesinPI7.1fromPI7.0
    u can chk tis article also:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508bb504-87cf-2c10-2aaf-f3a5df75e651?quicklink=index&overridelayout=true

  • Can't connect to my server socket using external IP

    Hi I'm very new to Java programming, and I'm learning all the core things I need to understand so that I can make a simple networked game using a command-line server and applet clients. I tried the networking tutorial and it worked perfectly on my machine.
    However, it only works if I supply the client with my INTERNAL IP. When I give it my EXTERNAL IP it cannot connect to the server socket. The error thrown is a IOException.
    The code:
    import java.io.*;
    import java.net.*;
    public class KnockKnockClient {
        public static void main(String[] args) throws IOException {
            Socket kkSocket = null;
            PrintWriter out = null;
            BufferedReader in = null;
            try {
                kkSocket = new Socket("192.168.2.3", 4444);
                out = new PrintWriter(kkSocket.getOutputStream(), true);
                in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));
            } catch (UnknownHostException e) {
                System.err.println("Don't know about host.");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection.");
                System.exit(1);
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String fromServer;
            String fromUser;
            while ((fromServer = in.readLine()) != null) {
                System.out.println("Server: " + fromServer);
                if (fromServer.equals("Bye."))
                    break;
                fromUser = stdIn.readLine();
             if (fromUser != null) {
                    System.out.println("Client: " + fromUser);
                    out.println(fromUser);
            out.close();
            in.close();
            stdIn.close();
            kkSocket.close();
    }The code works fine with my internal IP (192.168.2.3) but not my external IP (86.3.51.171). Any ideas about how to fix it?

    Not quite sure I understand. Do you use the external IP with clients
    from the external network or with clients from the internal network?
    But regardless, I assume your Java code is correct since it works
    on the internal network. Try this command:
    telnet 192.168.2.3 4444
    from the internal network. I expect it to show "Server: ...", whatever the
    server sends. If this works, it means we can indeed use telnet to
    test connectivity. Now do:
    telnet 86.3.51.171 4444
    from the machine that gives you problems. If this does not work
    (connection lost or something like this), it means your Java code is OK
    and you need to do some configuration at your router.
    If this works, which I doubt, I am on the wrong track.

  • How to use java to send emails

    Hi,
    I am having problems trying to send an email using java. No idea what is going on because it looks fine. Can anyone give any insight?
    Cheers
    Robert
    import java.awt.event.*;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    * JEmail.java
    * @author Robert Venning 18/09/2005
    * @version 1.0
    public class JEmail extends JFrame implements ActionListener{
         private static final long serialVersionUID = 1L;
         final int SMTP_PORT = 25;
         JLabel fromLabel = new JLabel("From: ");
         JLabel toLabel = new JLabel("To: ");
         JLabel ccLabel = new JLabel("CC: ");
         JLabel subjectLabel = new JLabel("Subject: ");
         JTextField from = new JTextField(20);
         JTextField to = new JTextField(20);
         JTextField cc = new JTextField(20);
         JTextField subject = new JTextField(20);
         JTextArea message = new JTextArea(10,30);
         JScrollPane scrollPane = new JScrollPane(message);
         JButton send = new JButton("Send");
         public JEmail(){
              super("Email Program");
              JPanel mainPane = new JPanel();
              JPanel pane = new JPanel();
              JPanel fromPane = new JPanel();
              JPanel toPane = new JPanel();
              JPanel ccPane = new JPanel();
              JPanel subjectPane = new JPanel();
              mainPane.setLayout(new FlowLayout());
              pane.setLayout(new GridLayout(4,1));
              fromPane.add(fromLabel);
              fromPane.add(from);
              toPane.add(toLabel);
              toPane.add(to);
              ccPane.add(ccLabel);
              ccPane.add(cc);
              subjectPane.add(subjectLabel);
              subjectPane.add(subject);
              pane.add(fromPane);
              pane.add(toPane);
              pane.add(ccPane);
              pane.add(subjectPane);
              mainPane.add(pane);
              mainPane.add(scrollPane);
              mainPane.add(send);
              setContentPane(mainPane);
              send.addActionListener(this);
         public static void main(String[] args) {
              JFrame aFrame = new JEmail();
              aFrame.setSize(350, 400);
              aFrame.setVisible(true);
         public void actionPerformed(ActionEvent event){
              try{
                   PrintWriter writer = new PrintWriter(new FileWriter("log.txt"));
                   String input, output;
                   Socket s = new Socket("mail.tpg.com.au", SMTP_PORT);
                   BufferedReader in = new BufferedReader
                        (new InputStreamReader(s.getInputStream()));
                   BufferedWriter out = new BufferedWriter
              (new OutputStreamWriter(s.getOutputStream()));
                   output = "HELO theWorld" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   output = "MAIL FROM: <" + from.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   output = "RCPT TO: <" + to.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
              //     writer.println(input);
                   output = "DATA" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
              //     writer.println(input);
                   output = "Subject: " + subject.getText() + "\n";
                   out.write(output);
                   out.flush();
              System.out.print(output);
              writer.println(output);
              output = "From: Robert Venning <" + from.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
              System.out.print(output);
              writer.println(output);
                   // message body
              output = message.getText() + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   output = ".\n";
                   out.write(output);
                   out.flush();
                   System.out.println(output);
                   writer.println(output);
                   output = "QUIT" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   writer.close();
                   s.close();
              catch(Exception exception){
                   exception.printStackTrace();
    }

    Hi, floppit. For sending emails, I used the JavaMail API. Here is some code I wrote where I used JavaMail. The most relevant lines are in bold.
    /*   File:  ListenNotifier.java
    * Author:  Fabricio Machado
    *          [email protected]
    * This utility is based on the "Listen.java" tool from the Tiny OS
    * java tools package, in /tinyos-1.x/tools/java/net/tinyos/tools/.
    * The original application has been extended to convert raw packet data into
    * a more meaningful representation of actual photo sensor readings in
    * lux.
    * The application checks the readings against a user-defined
    * threshold, and sends email notifications when readings break the
    * threshold, and also when readings dip back below the threshold.
    * Currently, the code is only fit to handle packets from the Tiny OS
    * nesc application OscilloscopeRF.nc.  The code gets the packet data
    * by connecting via TCP to a Tiny OS java tool called "Serial Forwarder."
    * "Serial Forwarder" takes packets from the base station, and forwards
    * them to TCP port 9001.
    * Below is UC Berkeley's copyright disclaimer regarding the original code.
    *                              |   |
    *                              |   |
    *                              |   |
    *                              |   |
    *                            __|   |__
    *                                v
    * "Copyright (c) 2000-2003 The Regents of the University  of California. 
    * All rights reserved.
    * Permission to use, copy, modify, and distribute this software and its
    * documentation for any purpose, without fee, and without written agreement is
    * hereby granted, provided that the above copyright notice, the following
    * two paragraphs and the author appear in all copies of this software.
    * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
    * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
    * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
    * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
    * Copyright (c) 2002-2003 Intel Corporation
    * All rights reserved.
    * This file is distributed under the terms in the attached INTEL-LICENSE    
    * file. If you do not find these files, copies can be found by writing to
    * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
    * 94704.  Attention:  Intel License Inquiry.
    import java.util.Properties;
    import java.io.*;
    import java.net.*;
    import net.tinyos.packet.*;
    import net.tinyos.util.*;
    import net.tinyos.message.*;
    import javax.mail.internet.*;
    import javax.mail.*;
    import java.util.*;
    public class ListenNotifier{
        public static void main(String args[]) throws IOException, MessagingException {
         int i;
         int j = 0;
         Integer threshold=0;
         String to="";
         String timeStamp;
         // Check to see if user is running the program correctly.
         // If -T option is not used, a default value of 250 lux is
            // set as threshold . . .
         switch (args.length){
         case 0:
               System.err.println("usage: java ListenNotifier < EmailAddress1 > <  EmailAddress2 > . . .  -T < Threshold >\n");
               System.exit(2);
               break;
         case 1:
             to = args[j];
             threshold = 250;
             break;
         default:
             if (args[args.length-2].equals("-T")){
              threshold = threshold.valueOf(args[args.length-1]);
              to = args[0];
              while(!args[j+1].equals("-T")){
                  to = to + " " + args[j+1];
                  j++;
              break;
             else{
              j = 0;
              threshold = 250;
              to = args[j];
              while((j + 1) < args.length){
                  to = to + " " + args[j+1];
                  j++;
              System.out.printf("Mailing list is: %s\n", to);
              break;
         // Connect to the Serial Forwarder on TCP port 9001 . . .
             PacketSource reader = BuildSource.makeSF("192.168.0.12",9001);
         // Check to see if connection to Serial Forwarder successful . . .
         if (reader == null) {
             System.err.println("Invalid packet source (check your MOTECOM environment variable)");
             System.exit(2);
         try {
             // Use JavaMail API methods to set up an
             // email session . . .
          Properties props = System.getProperties();
         Session session = Session.getInstance(props, null);
         javax.mail.Message message = new MimeMessage(session);
             // Open the packet source . . .
             reader.open(PrintStreamMessenger.err);
             // Set a threshold boolean to be used so
             // email is sent only once after threshold
             // is exceeded.
             Boolean limit = false;
             for (;;) {
              // The node ID field in the OscilloscopeRF packet
              // is 2 bytes long, but all byte pairs in the packet
              // are in little endian order.  Thus, the bytes must
              //  be re-ordered.  They are then converted to unsigned
              // integers and added together to obtain the node ID.
              byte[] packet = reader.readPacket();
              Integer nodeID = (( int ) packet[5] & 0xFF) + ((( int ) packet[6] & 0xFF)<<8);
              System.out.printf("Packet from node %d . . . \n", nodeID);
              // Begin extracting data payload of sensor readings,
                    // which are stored in the last 20 bytes of the packet . . .
             for (i = 0; i <= 9; i++){
              // Convert reading to integer, display on screen . . .
              Integer sensorData = (( int ) packet[(2*i)+11] & 0xFF) + ((( int ) packet[(2*i)+12] & 0xFF)<<8);
              System.out.printf("Sample %d reading at %d lux.\n", i+1, sensorData);
              // Is sensor reading  above limit?
              if(!limit && (sensorData >= threshold)){
                  limit = true;
                  System.out.printf("WARNING: SENSOR READING ABOVE THRESHOLD--SENDING NOTICE BY TEXT MESSAGE.\n");
                  // Compute a time stamp for when threshold was exceeded.
                  java.util.Locale locale = Locale.getDefault();
                  java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.LONG,
                                                                  java.text.DateFormat.LONG, locale);
                  timeStamp = dateFormat.format(new java.util.Date());
                  // Build message and send to recipients in mailing list . . .
                  message.setFrom();
              message.setRecipients(javax.mail.Message.RecipientType.TO, InternetAddress.parse(to, false));
              message.setSubject("WARNING: NODE " + nodeID.toString() + " SENSOR READING ABOVE THRESHOLD!");
              message.setText("Node " + nodeID.toString() + " sensed " + sensorData.toString() + " lux on " + timeStamp + "\n");
              Transport.send(message);
                  System.out.printf("%s\n",timeStamp);
              //  Has sensor reading now dropped from above threshold to below threshold?
              //  Same concept as before . . .
              if(limit && (sensorData < threshold)){
                  limit = false;
                  System.out.printf("READING BELOW THRESHOLD AGAIN . . . SENDING NOTICE BY TEXT MESSAGE.\n");
                  java.util.Locale locale = Locale.getDefault();
                  java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.LONG,
                                                                  java.text.DateFormat.LONG, locale);
                  timeStamp = dateFormat.format(new java.util.Date());
                  message.setFrom();
              message.setRecipients(javax.mail.Message.RecipientType.TO, InternetAddress.parse(to, false));
              message.setSubject("NODE " + nodeID.toString() + " READING BELOW THRESHOLD AGAIN.");
              message.setText("Node " + nodeID.toString() + " sensed " + sensorData.toString() + " lux on " + timeStamp + "\n");
              Transport.send(message);
                  System.out.printf("%s\n",timeStamp);
             System.out.println();
             System.out.flush();
         // Catch IOException from Tiny OS java method, and
         // MessagingException from setRecipients method in JavaMail API . . .
         catch (IOException e) {
             System.err.println("Error on " + reader.getName() + ": " + e);
         catch(MessagingException e){
         System.err.println("Error in javax.mail.message.setRecipients:\n" + to);
    }

  • How to install JAVA API client files :: Using JAVA Proxy & NWDS

    Hi
    I am going to integrate the SAP with one "AB" System which is providing Java API to integrate with their client ( which in turn will connect with AB System ). So AB System is providing JAR files & property files, in order to instantiate objects & call those APIs.
    Now I am going to write the JAVA code in NWDS which is installed on my Laptop so I am sure I need to give this jar files under ::
    <i>Project -> Properties and then Java Build Path -> Libraries.
    Choose Add External JARs</i>
    But where do I need to add property files.
    Also do I need to install the same files on XI Server too & do I need to install the "AB" System Client also on XI Server or it can be installed some place else too.
    Regards
    - Lalit -

    Lalit,
    ><i>But where do I need to add property files</i>
    How are you going to access the properties file? Are you going to use Java IO to read the file or are you dgoing to bundle the property file as a resource and use the getResource() . If you are going to use Java IO then you will have to hard code the property file path in your code and make sure that your Proxy can read the property file.
    If your property file is going to vary across environments, I woudl suggest this approach. Make sure that the property file path will be same in all environments and it will work fine and make sure that your proxy will have OS level IO access as well.
    Another option would be to have the property file bundled as a respurce, but, making changes to the file in this case will be an issue!
    ><i>Also do I need to install the same files on XI Server too & do I need to install the "AB" System Client also on XI Server or it can be installed some place else too.</i>
    When you create the EAR file for your Java Proxy, remove all XI .jar files and just make sure that the Client JAR is available in the EAR file. You need not install the Client JAR file anywhere as long as the jar file is a part of the EAR!
    Regards
    Bhavesh

  • Identify the number server calls using java

    how to identify the number server calls that are made for rendering the page, Also have each call transmission data too.using java language.

    What??? What are you talking about? What environment? What server?

  • Authenticate against windows 2000 server securtiy using Java.JNI

    How could you use Java or JNI to read the password and group membeship from the operating system for a given windows 2000 user, from a servlet/class?

    Are you looking to build some sort of single sign-on module? You wouldn't be able to get the password, but you might be able to pass a token indicating the users credentials. You'd have to delve into the MSDN resources to get that.
    Once you figure out how to what you want using COM, you can more easily integrate it into Java using the sourceforge projects Jacob or JAWIN.

  • Configuring the application server to use HTTP proxy server

    Hi,
    I am trying to configure LiveCycle ES2 to access services over the internet and since my Livecycle server connects to internet through a Proxy server, I have referred to section 5.8.2 of LiveCycle install_weblogic.pdf that states the following:
    If the computer that LiveCycle ES2 is running on uses proxy settings to access external web sites, the
    application server should be started with the following values set as Java virtual machine (JVM)
    arguments:
      -Dhttp.proxyHost= [server host]
    -Dhttp.proxyPort= [server port] 
    However, I am getting the below exception while running the LC application as my Proxy server requires User credentials to connect to the internet:
    weblogic.net.http.HttpUnauthorizedException: Proxy or Server Authentication Required.
    I tried providing the below JVM startup argument too, but no luck:
    -Dhttp.proxyUser= [proxy user]
    -DhttpPassword= [Proxy password]
    Can you please suggest how to configure User credentials for the Proxy server in Livecycle.
    Thanks in advance.

    Hi WASIL,
    Thank you for your response.
    I have followed the above document suggested by yourself and the relevant steps while setting up the Server and the Workbench, and verified the settings too.
    The installation guide does highlight the steps to configure a Proxy server. However, the guide does not mention anything about how to handle Proxy server authentication.
    Please note that there are Proxy authenication options available in Workbench to configure how the Workbench connects to the LiveCycle server, whereas the problem I am facing here is how to connect the LiveCycle server with internet services through a Proxy server.
    I hope that clears the problem statement.
    Thankyou for your assistance.

  • Need help in desigining Client/Server Application using Java

    Hi,
    I am new to Java and no sooner that I started studing it I have been given a project - client server java Application that allows a user to do a property search based on critiras (eg location, price) and display the results. I am stuck because I don't know where I need to start. Have to use IDE (Netbeans or Eclipse) but not sure about dev frameworks.
    Can someone give me an outline of what I should do / where I should start? What will be the best solution?
    Thanks in adance

    http://java.sun.com/docs/books/tutorial/networking/index.html
    That's Sun's networking tutorial series. Live it, learn it, love it. You'll need to decide if you want to use connected sockets or datagrams. You'll need details like, can multiple clients connect simultaneously?
    The tutorials are the first step though.

  • Is it possible to remove Locks in SQL server 200 using java code...???

    Hi floks,
    I had i trickey situation in which my application is creating the locks over the tables in the
    DB(SQL server 2000) . Iam using Struts frame work 1.1 + jsp in our application.
    Iam bit worried wether the locks can be removed with the java code which suits the Struts
    framework...
    Please help me with proper code snippet to over come the situation.
    Thanks in anticipation
    Shiv

    iam looking to make a query in such a way that it can be triggered with
    java code whish removes all the locks
    is it possible...?
    i tried the nolock situation even i cant get the situations
    and the query where it is getting locked as our application is big enough with
    numerous number of queries

  • Using Java to Send Message to BlazeDS

    Hello all, maybe you can help me with my problem.
    I've created a very simple java program that should have no problem sending a message to BlazeDS.
    Java App Code
    import   flex.messaging.MessageBroker;
    import   flex.messaging.messages.AsyncMessage;
    import   flex.messaging.util.UUIDUtils;
    public   class BlazeDSTest
        public static void main(String[] args) 
              MessageBroker msgBroker = MessageBroker.getMessageBroker(
    null);
              String clientID = UUIDUtils.createUUID();
               AsyncMessage msg = new AsyncMessage();
              msg.setDestination(
    "chat");
              msg.setClientId(clientID);
              msg.setMessageId(UUIDUtils.createUUID());
              msg.setTimestamp(System.currentTimeMillis());
              msg.setBody(1);
              msgBroker.routeMessageToService(msg,
    null);
    ok, pretty simple.  Now i'm getting a null pointer exception error when i try to run the routeMessageToService function.
    Either i don't have my config,services xml set right or what, i have no idea why it can't find the message channel "chat".
    I know it's in there.  I see it under the BlazeDS samples.  Is there something i need to set to specifically target a certain "folder" in blaze ds?
    I want this java program to just run on the server (that blazeDS is installed on), anywhere in the os.
    So like this....
    JavaApp Runs -> JavaApp gets message from outside source -> JavaApp sends messages to BlazeDS -> Clients subscribed to Blaze get message
    Pretty easy...but i'm beating my head.  Anyone please?
    Thanks!
    -kevin

    Hi
    With the new 4.6 version of Adobe Data Services, you can also create Java (desktop/Android) and JS/ObjectiveC applications that can communicate with a messaging destination.
    http://help.adobe.com/en_US/dataservicesjee/4.6/Developing/WS4976f0ec3ef48246-681f784e12dc 3e803c6-8000.html
    Regards,
    Ashish Vashisht

  • Store&read chinese characters in MS SQL server 2000 using Java

    Hi,
    I have a problem to store Chinese characters in MS SQL Server 2000, storing question marks(??????) instead of Chinese characters
    I am using JSF framework, SUN APPLICATION Server 9.1 , MS SQL Server 2000 server and Microsoft data source driver class (com.microsoft.sqlserver.jdbc.SQLServerDataSource) to connect db.
    I have one solution:
    IN JSP:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and
    In database column type should “nvarchar” in place of varchar
    while inserting or updating the same need to add ‘N’ prefix with the value like insert into client(Name, Id ….) values (N+)
    the above is working fine but the problem is here i have already defined database with 100s of tables I cant change database tables as well as queries
    Thanks,
    Sathi

    I don't know any betterer option, than to copy the database tabels redefining the Chinese data fields as nvarchar.
    To be frank I had also problems writing to a html file Chinese text stored in MS SQLServer 2000 nvarchar fields.
    The following worked:'
         public String getEncodedData(ResultSet resultSet, int columnIndex, String charset)
         throws SQLException
              //final String methodName = "getEncodedData";
              InputStream binaryStream =resultSet.getBinaryStream(columnIndex);
              String readStringFromStream=readStringFromStream(binaryStream, charset);//UTF_16LE);
              return readStringFromStream;
         public String readStringFromStream(InputStream inputStream, String charset) {
              final String methodName = "readStringFromStream";
              StringBuffer buffer = new StringBuffer();
              try {
                   int ch;
                   InputStreamReader isr = new InputStreamReader(inputStream, charset);
                   Reader in = new BufferedReader(isr);
                   while ((ch = in.read()) > -1) {
                        buffer.append((char)ch);
                   in.close();
                   return buffer.toString();
              } catch (IOException exception) {
                   Log.printError(this,methodName, exception);
                   return null;
         }And writing it to file:
         public void writeEncodedStringToFile(String text, String filePath, String charset, boolean append){
              final String methodName = "writeEncodedStringToFile";
              OutputStreamWriter writer= null;
              try {
                   FileOutputStream fileOutputStream = new FileOutputStream(filePath, append);
                   writer = new OutputStreamWriter(fileOutputStream, charset);
                   writer.write(text);
              } catch (IOException exception) {
                   Log.printError(this,methodName, exception);
              }finally{
                   try {
                        writer.close();
                   } catch (IOException exception) {
                        Log.printError(this,methodName, exception);
         }Edited by: astlanda on Feb 10, 2009 11:13 PM
    Edited by: astlanda on Feb 10, 2009 11:21 PM

Maybe you are looking for