Communication with database using TCP sockets connection

Hi all,
I am bit of a newbie when it comes to databases. In a project I realised over te passed few weeks, I communicated with an 11g database using an application I created with VS Express. It uses an ODBC connection. I now want to connect a PLC to the same database. These PLC's don't have the ability to install an ODBC client so I need something different.
I am easily able to open a TCP socket on the PLC and send data from there. I would like to know if I can start a TCP sockets connection with our 11g server and send all queries directly. The other (already suggested) option would be to have the PLC connect to a PC that reads this information and hands it over to the ODBC connector, but that would mean I need an extra PC just to 'translate'.
I have been searching these forums for socket, TCP and more and feel it is possible, but I need a good document as a reference to show/tell me how it's done.
Thanks in advance,
Marijn

The TCP/IP interface to Oracle is undocumented (and hugely complex anyway). You'll need to use a higher layer iterface or setup your own infrastructure.
We need more information about what is available to you inside the PLC.
Can you use Java? If so, perhaps use thin JDBC?
Can you sent HTTP requests? If so you could set up your own Web services to handle this.
If you can only use C or C++, Oracle has interfaces there too.. it's called OCI (Oracle Call Interface) and thats as close to the networking layer as you can get.
Finally if you can use .NET Oracle has a Fully Managed Oracle Data Provider for .NET that you could use.
But if all you can do is super low level network access and none of the above then you will need to set up an intermediary as you mentioned.

Similar Messages

  • Communicating with Crestron using tcp/ip sockets

    Greetings...
    I trying to finish a desktop application written in Java that connects to an automation controller(Crestron) via sockets (TCP/IP). My main problem is that the connection is constantly going down. I have a thread that is always running to check if the connection is up, when it's brocken just puts it up again.
    Then i have another thread that's always running also to get the data that the
    Crestron controller sends me.
    The connection is broken usually by receiving a null.
    Is there any tip to solve this kind of trouble?
    The java app. is client and the Crestron is a server. Also i'm running the app. in Windows XP.
    It's a fix ip and the port is 4444.
    Also if anyone has experience of making software that interects with Crestron Controllers, please tell me something.
    Thanks for the help

    Sorry, but if your connection keeps getting dropped and your client does not close the connection then there is only one source: the controller itself is closing the connection. It may be some kind of timeout that is causing that the connection is closed. In any way, it is most likely not java but hardware / setting related.

  • Can I connect with Database using Session Bean

    Hi,
    I am new to EJB. I have small doubt.
    can I connect with Database using Session Bean.
    Regards,
    Murali.

    Double post of http://forum.java.sun.com/thread.jspa?threadID=687239&tstart=0

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • Interface of Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol

    Hello.....
    I want to connect a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    The PLC which I am using is a series of 1766BWA (Allen Bradley) please can you help me for the same or please give me suggestion.
    Also I want to know the resistance values of this PLC.
    Thank you.

    Hello
    I was trying for connection of a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    Here I am attaching the snapshot of PLC interfacing and communication vi using modbus but it is not working
    For reading we use setting shown in CHANNEL 1-modbus but it gives error regarding modbus addressing
    and for writing it shows error illegal address please help me for the same.
    Thank you.
    Attachments:
    PLC_SCREEN.zip ‏261 KB
    Modbus_(Read-Write).zip ‏14 KB

  • Windows Media Player no sound while playing a avi file in server and client connection using TCP/IP connection

    Hello there
    I have a problem with my windows media player while using server and client connection by using TCP/IP connection. So when I play a video using Windows Media Player in LabVIew there isn't any sound come out but when I'm playing a video by a Windows Media Player only the sound will come out. Can you help me solve this problem?
    I also upload the vi as the reference.
    The username for the client is ihsanhaikalz and the password is ganteng
    Thanks
    Attachments:
    Client Remote.vi ‏746 KB
    Server Remote.vi ‏1433 KB

    Hi ican,
    I was looking at your VI's but I cannot seem to pinpoint exactly where you are using Windows Media Player.  In order to more quickly assist you, could you please recreate this issue more concisely in a smaller set of VIs.  Also, were you able to get sound when you did not use the TCP/IP connection and simply played the files in LabVIEW?
    I noticed in a few places that you were using the Play Sound File.VI from the Graphics and Sounds palette.  Is that what you are refering to?  I noticed there that the file path that you have designated for the song is simply the song title.  Instead, this should be a path to where the song is located on your computer.
    Also, if you are planning on using Windows Media Player, have you considered using the ActiveX commands for Windows Media Player?  Here are a few examples if you are unfamiliar with this functionality.
    Example 1 and Example 2.
    I hope this helps!
    Kim W.
    Applications Engineer
    National Instruments

  • How to send packet using tcp socket ?

    hi ,
    i want to using tcp socket to send data in ipv6 environment. but why the data transfer is less than ipv4 environment?
    socket = new Socket("2001:0238:0600::2", 1234);am i wrong ?

    bobby92 wrote:
    why the data transfer is less than ipv4 environment?What do you mean?
    >
    socket = new Socket("2001:0238:0600::2", 1234);am i wrong ?No idea, since I've no idea what you're asking.

  • I want to do communication via ethernet using TCP/IP

    i want to do communication via ethernet using TCP/IP i did it but code is runing but im not getting any output

    Look on this easy example: http://www.labviewtutorial.eu/viewtopic.php?f=14&t=328
    You will find there two identical VIs (only port numbers are different). One is for PC1 and other for PC2. If you will get prodlems starting VIs, so look on your firewall settings, you have to unlock ports used in these VIs.
    LabVIEW Portal

  • "An error occurred when communicating with the server. Check connectivity with your administrator to determine whether further action is necessary", then attempt to approve TimeSheet.

    Kind day, colleague.
    It was required to organize a statement chain for TimeSheet of employees, as we realized. Everything is good, but at linear managers in PSW opportunity to execute Approve when viewing TimeSheet of the employee remained, and in attempt to approve TimeSheet there
    is a mistake.
    500 Internal Server Error
    "An error occurred when communicating with the server.  Check connectivity with your administrator to determine whether further action is necessary. "
    Accept, is carried out as it is necessary.
    It is a bug or we not correctly realized approval chain?

     issue is  related to the user booking time against a task that was past the finish/end date listed in the Project Schedule.
    To resolve the user needs to submit their time on a valid task that is still within the current reporting timeframe, or have the Project Manager
    update the task in questions so that the finish/end dates are at or beyond the submission period and then republish the project. After that, the user should be able to go in and submit their timesheet with success.
    http://patrickdrews.com/2012/09/project-server-2010-timesheet-submission-produces-an-error-occurred-while-communicating-with-the-server/
    kirtesh

  • P6 Web Access connection to MS SQL Server database using TCP Dynamic Ports

    Hi,
    I am attempting to install P6 Web Access. When I run the installation and do the database configuration I am required to input a port number into the Database Host Port field. I do this and no error is displayed graphically, but I get a connection refused error when I look in the web access log.
    "com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect "
    The dba is running the database on an sql server farm and does not want to apply a static tcp port to the Primavera database as this will interfere with his other databases.
    The fact that it appears to be mandatory to input a host database port during database configuration, has me thinking that P6 Web Access requires that the database be set up with a static TCP port? Is this correct?
    I searched the documentation about this but came away with nothing...
    any help would be truly appreciated.
    Andy

    At my previous company we experienced a similar issue with P6 Web. Our P6 database was hosted on an Oracle RAC and when configuring the Web connection I was forced to point it to a single RAC server rather then allow it to utilize the cluster. If you have found a resolution to this I would be interested in hearing about it.

  • Connecting with database using setproperty over SOAP connection

    The following method connects to a MySQL database.
    public void setDBDriverName(String in)
         dbDriverName = in;
    public void setDBConnection(String in)
         dbConnection = in;
    public void connectToMySQLDatabase() throws SQLException
         if(dbCon == null)
                 try
                    Class.forName(dbDriverName);     // SQL driver
                    dbCon = DriverManager.getConnection(dbConnection);           // JDBC url
                    s = dbCon.createStatement();
                       catch (Exception e)
                    System.out.println("Could not connect to database using " + dbConnection + " at " + dbDriverName + " : " + e.getMessage());
         else
                System.out.println("Could not connect to databse : Already connected");
    }The method is part of a webservice, in which I use setproperties to set the database connection because the webservice must work with different types of databases like Oracle and MySQL.
    <jsp:useBean id="ContactHistorieClassid" scope="request" class="proxy.soap.ContactHistorieClassProxy" />
         <jsp:setProperty name="ContactHistorieClassid" property="DBConnection" value="org.gjt.mm.mysql.Driver" />
         <jsp:setProperty name="ContactHistorieClassid" property="DBDriverName" value="jdbc:mysql://localhost/contacthistorie" />
         <jsp:setProperty name="ContactHistorieClassid" property="clientID" value="1" />
    <%
         ContactHistorieClassid.connectToMySQLDatabase();
    %>What am I doing wrong here?

    Forgot what happens, sorry. After trying to use the ContactHistorieClassid.connectToMySQLDatabase() method, my server console tells me that it cannot connect to the database, even though it returns the values as they were set in the setproperty.
    When I manually enter the values like this...
    Class.forName("org.gjt.mm.mysql.Driver");     // SQL driver                
    dbCon = DriverManager.getConnection("jdbc:mysql://localhost/contacthistorie"); .. it works properly. So the setproperties are executed as the should be.

  • Problem with Java Proxy and Socket Connection

    Hi Gurus!!
    I have developed a Java Proxy that connects via socket with a Server Socket application. This Server Socket application accepts more than one connection at the same time.
    When I connect the first time from my Java Proxy, the connection is correctly established. When the first connection opened, if a try a second connection, this is not established.
    I use "new Socket(SocketServer,SocketPort);" to open the connection.
    I think that all time the Java Proxy is trying to open the same connection, and this is a problem.
    Is there a way to indicate to the server that is a new connection and that the existing connections remain?
    Anybody could help me, please?
    Thanks and regards,
    Manuel Míguez.

    Sorry!!!!i must give you more information.
    The error which i have when i push the submit button is
    HTTP Status 404 -
    type Status report
    message
    descriptionThe requested resource () is not available.
    GlassFish Server Open Source Edition 3.0.1
    My thought is that the error is in this line
    String connectionURL = "jdbc:mysql://localhost/mybooking";in mysql when i write this code then the table opens with no problems:
    mysql>show databases;
    mysql>usebooking;
    mysql>showtables;
    mysql>describe booking;Furthermore i have added in my web application the library mysql JDBC driver my-sql-connector-java-5.1.6.bin.jar
    Edited by: 813355 on Nov 22, 2010 1:50 AM
    Edited by: 813355 on Nov 22, 2010 2:00 AM

  • Problems communicating with device over TCP/IP

    Greetings,
    In designing a GUI for a device with both RS-232 and TCP/IP communications capability, I've run into quite a puzzling issue that has me stumped and my brain in pain.  You can query and send commands to this device using ASCII commands.  Developing the serial port communications aspect of the GUI was trivial.  My problem with TCP/IP is this:
    I first establish the TCP connection using the "TCP open" vi.  I then send my ASCII command or query (that is CR terminated) using "TCP write," pause for 250 ms, and then read using, "TCP read" in the CRLF mode (the device does respond with CRLF line termination).  Success using this method in LV is intermittent, especially when I put the write/read vi in a loop and go between querying and sending commands-only.  As a matter of fact, if I am only querying the device, it will run indefinitely without any problems and my front panel indicators display values from the read buffer.  As soon as I send a command (to change a setting, for example), an error is propagated and the GUI no longer receives the data from the read buffer.  More recently, I've found out that the device is definitely receiving the commands even when the GUI fails to retrieve the read buffer, because I can send a query, switch over to hyperterminal, and hit return... it displays my response in HT without my even having to type in a command!  I'm totally stumped here, as I've played around with all kinds of delays in different places, different read modes, opening/closing connections, etc.  I even tried putting in a redunant "dummy" read by itself, and a dummy read following a write with just a CR as the command (I thought this might solve my problem based on the behavior I saw when switching over to hyperterminal).
    I've been searching the discussions for similar problems, but to no avail.  I have read that TCP communications is handled by the OS, so perhaps this is where I am running into trouble?  Any help, advice or suggestions are greatly appreciated.
    (A little bit more information on the device: The way I want the device to work is as a monitor, so it should be querying indefinitely unless the user sends a command to update a setting, at which point it would send the command and then resume monitor status).

    Hello CryoGuy,
    Thanks for the question.
    Your description seems to fit this KB about poor performance in TCP read.  If this document isn't helpful, please let us know the following:
    1.  Which OS are you using?
    2.  Which version of LabVIEW are you using?
    3.  What's the specific error number and message you're getting?
    4.  At which function in LabVIEW are you seeing this error?  (Turn on highlight execution to see where the error starts if the message doesn't say.)
    Thanks,
    Lisa
    Applications Engineer
    National Instruments

  • Servlet communicating with database

    Hi ,i need 2 forms (html pages) where i can insert soem data in form1 (3 textfields)and some data(3 textfields) in form2,form1 is cnnected to form 2 with a continue button.then i mapped a java file page1 from form 2 then to database using page1 and dbconnection and started tomcat server.now tomact run succesfully but i am not getting values i inserted in form1 in the database but can get teh values in from2 .after form2 page is directed to javafile url/page therei can see the message as
    conn est record inserted null null null software computing eng
    also Database showing last 3 column values i.e software, computing ,eng

    The more I read your post, the more confused I got. Try to run the forum's built in spellchecker before posting the message.

  • Communicating with xstring to Oracle Inter Connect

    Hello,
    We're using Oracle Inter Connect to communicate between SAP and other applications. To do so, we build remote enabled function modules.
    We now have the problem that Inter Connect does not find RFC's which have parameters which are reffered as TYPE (fe i_matnr type matnr).
    We want to use the xstring as importing and exporting parameter, but we can not refer to it as LIKE (fe i_matnr like mara-matnr).
    Does anyone have expirience with this problem or has a solution?
    Regards,
    John

    No suggestions?

Maybe you are looking for

  • Dedicated Graphic Card Failure (ATI) - HP Pavilion DV6

    Hey guys, I have HP pavilion Dv6 which have AMD Radeon Graphics card(may be 69xx or 74xx radeon series 1Gb ddr3). Currently i have installed Windows 7 & Ubuntu(Dual boot). Problem: I was playing NFS when the system froze,so i turned it off forcefully

  • Why is iTunes 10.5.1 so freaking awkward?

    So my mum's friend has an iPhone 3G. She want's to download a ringtone to her phone and gets the message "Tones are not available on this device" and gets told they need iOS 5, which by the way, isn't available for her. So after long and tedious atte

  • Save iPhoto library to icloud

    How can I save my iphoto library to the cloud?

  • Things possible in Netweaver ABAP Trial Version.

    Hello, Could you please suggest me some Tutorial/Notes/links/files... to know what are all the things possible in Netweaver ABAP Trial Version. And the difference between Netweaver ABAP Trial version and original version.

  • Too much XML?

    Do you think there comes a point where an XML document becomes too big? I was asked to analyze the authorization scheme used for a particular application. The application resources, access to which the authorization must be regulated, are defined in