Best way to communicate with a database

I'm starting on a client/server implementation. The client will be the entire GUI for the database. How would I communicate over sockets with this? Would string commands to stdIn do? What's the most flexible implementation?

I think sockets is a very low level to communicate with the server.
I'm working with JDBC on MySQL and there's a method:
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/myDatabase", "me", "my_password");
where you could connect with the database called "myDatabase" located in localhost with login = "me" and password = "my_password".
I think you could connect with a server located on machine named "myDomain.com" like this:
Connection con = DriverManager.getConnection("jdbc:mysql://myDomain.com/myDatabase", "me", "my_password");
Check the JDBC documentation to be sure.
Hope that helps.
Regards.

Similar Messages

  • Best way to communicate with IEEE device

    Hi everyone;
    I'm using a Magtrol DSP6001 Dynamometer Controller to control a
    dyno.  It's GPIB, and I'm able to communicate with it swimmingly,
    and I've used it it a number of other apps that I've written.
    My problem now is, that I need to be reading the device as fast as
    possible, but at the same time, setting the torque at regular
    intervals.  Here's a better explaination:
    I'm controlling a stepper motor (which is the main problem, as all the
    other motors I have written apps for using this equipment have been
    brushless servos) for an acceptance test, and part of the test requires
    that the torque be ramped up gradually until the motor starts missing
    steps, and the torque at which this happens is recorded.  The
    problem is, in order to accurately record the torque value, I need to
    be reading the device constantly (not a problem, as the controller is
    capable of providing 100 samples/second), but at the same time
    gradually increasing the torque.
    You can see where the problem arises...  if I were to multi-thread
    this vi, then I would get randomly occurring IEEE errors, but if I have
    the data acquisition in the same loop as the torque increase, then I
    don't get nearly enough accuracy.  Is this something that a
    semephore would be useful for?  I have heard something about the
    IEEE bus being able to handle some sort of syncronization, but I don't
    know much about that...does anyone else?
    Has anyone else had this sort of problem before?
    Thanks, Geoff
    Notes: I'm running the controller in open loop mode... for two
    reasons.  One, it's easier to have a smoother ramp in open loop by
    the nature of the commands used to communicate with it, and two, trying
    to obtain the PID settings for this motor was getting to be an absolute
    nightmare, and I don't think it worth the time, as it's just a ramp,
    not a constant torque.  Or am I wrong in thinking that?

    Thanks for the reply, but I suppose I should have been more clear...  it doesn't exactly answer my question.
    I have two loops, both of which need to communicate with the
    controller.  One loop (top in the image) I need to run several
    times faster than the bottom loop, as I need greater accuracy in the
    readings (more samples).
    The bottom loop will run not as fast as possible - as the top loop will
    - but will run every say, 20 milliseconds.  You might be asking
    why that's not in the image, but that's just the bare bones of what I'm
    trying to do. 
    I can't leave them to their own devices as is, since I'll get random
    GPIB errors because both might be trying to write at the same time, or
    one might write before the top has read, and then the read will return
    an error. 
    I was just wondering what the best way to go about doing this
    is...  I'll try using queues to do this type of operation, sorta
    like you suggested.
    Has anyone ever heard of GPIB being able to do synchronized
    communication?  (as in, is there a way to have two pieces of data,
    one being written and one being read, from the GPIB bus at the same
    time?  Like, being able to read what's been returned by the
    controller, but at the same time writing a new command to the bus?)
    Message Edited by Novatron on 07-28-2005 03:49 PM
    Attachments:
    Example.jpg ‏89 KB

  • Best way to communicate with MySQL?

    Hello everyone,
    I'm here seeking some advice for an application I'm about to
    build. This application hopefully will be used in the recording
    studio facility where I work. The purpose of the application is to
    store information about each studio session. I've never build an
    application of this kind so I'm not sure about what would be the
    best coding practices. I think I have enough AS skills to create
    such a project, but since I'll be using a MySQL database to store
    ad retrieve data for the first time, I was wondering if you guys
    could give me some advice. I alredy know how to use PHP and
    LoadVars to send data from Flash to MySQL, and also how to send
    back the data in xml format. What I'm not sure is how to retrieve
    data for different queries. Would be better to create a XML object
    for each different query with a different LoadVars object for
    sending the right variable for a particular query, or is there a
    better way to make the whole process more efficient? I hope this
    make some sort of sense. Thanks in advance for the help
    -Luca

    http://www.amfphp.org/
    once you´ve experienced this open source project,
    you´ll never want
    again to "manually" create XML or LoadVars objects.
    check it out, it´s GREAT!
    perry
    LucaLT schrieb:
    > Hello everyone,
    >
    > I'm here seeking some advice for an application I'm
    about to build. This
    > application hopefully will be used in the recording
    studio facility where I
    > work. The purpose of the application is to store
    information about each studio
    > session. I've never build an application of this kind so
    I'm not sure about
    > what would be the best coding practices. I think I have
    enough AS skills to
    > create such a project, but since I'll be using a MySQL
    database to store ad
    > retrieve data for the first time, I was wondering if you
    guys could give me
    > some advice. I alredy know how to use PHP and LoadVars
    to send data from Flash
    > to MySQL, and also how to send back the data in xml
    format. What I'm not sure
    > is how to retrieve data for different queries. Would be
    better to create a XML
    > object for each different query with a different
    LoadVars object for sending
    > the right variable for a particular query, or is there a
    better way to make the
    > whole process more efficient? I hope this make some sort
    of sense. Thanks in
    > advance for the help
    >
    > -Luca
    >

  • What is the best way to communicate with a DL 450/ECom Ethernet to Lookout 6.1

    I have an application that requires Lookout 6.1 to communicate to an Automation Direct PLC HE-ECOM (ethernet) module with a D4-450 CPU. Is there any software that comes with Lookout 6.1 that will let me do this if not what do I need to purchase for this application.

    If your ecom module is an H4-ECOM then you can use either the Directlogic Plus driver available from Automation  Direct or one of the OPC servers that supports the H4-ECOM; If your ecom is an H4-ECOM100 than you can use either Lookouts built in MODBUS TCP driver or the above two drivers. My personal preference is DirectLogic plus because it is an add on Lookout driver object and you don't have to keep track of the MODBUS equivalent addresses. The cost of the DirectLogic Plus is comparable with the lower cost OPC servers.
    Jim Besselman

  • Best way to communicate OW 2.6.3.5 with 8.1.7

    I have OW 2.6.3.5 installed on oracle DB 10.1.0.3, and my application jdev the data is stored in 8.1.7, i need to call oracle wf PL/SQL to raise events, functions, etc from my application 8.1.7 . Which is the best way to communicate both, dblinks ?
    Please advice,
    thanks

    Similar problem here, after updating xorg and nvidia driver the system freezes with nvidia logo on display and caps lock and scroll lock leds blinking.
    I got nvidia geforce 7300.
    Any solution to this besides downgrading?

  • What's the best way to deal with floating point errors?

    What's the best way to deal with the decimal number errors in Flex?
    Lets say I have:
    var number1:Number = 1.1;
    var number2:Number = 1;
    var result:Number = number1 - number2;
    trace(result);
    I get "0.10000000000000009".
    What's the best way to deal with this so that i get the right result?
    Using the trick: result = Math.round( result * Math.pow(10,13) ) / Math.pow(10,13); is not useful as such when using big numbers.
    For example, If number1 = 100000000001.1, and number2 = 0.2, I get "100000000000.90001" as result. The previous rounding fixes rounding errors after 13th decimal, but here the first rounding errors come after 4 digits.
    The toPrecision method in Number and NumberFormatter dont seem be of use by themselves because of the same reason.
    So I'd have to check how big the number is, and then round the number based on that.
    So far I've constructed a method that does that with logarithms like this:
    public function floatFix(number:Number):Number{
          var precision:int = 14-Math.floor(Math.log(Math.abs(number))*Math.LOG10E);
          var precisionFactor:Number = Math.pow(10, precision);
          return Math.round(Number(number*precisionFactor))/precisionFactor;
    It just seems rather odd that one would have to create and use something like that to just count 1.1-1; There's a lot of calculating in that method, and i'm guessing that having to use that in a loop could slow down a program quite a bit.
    I think there really should be a pre-built method in flex for something like this, but I can't find any.
    Anyone know any better/faster ways?

    Use the application server database pooling services to create a datasource that can be access using JNDI.
    Move the database access code to a Servlet so that a JSP submits a form to the Servlet that does the database access and packages the data into a bean which is passed to another JSP to be displayed.

  • Best way to deal with hard coded variables in a package

    There is a plsql package that reads a line from a file, parses the data, does a ton of sql operation with it (select update, inserts, calculations) and then writes the output to an output file.
    The file names and the firectories are retieved from a database table.
    Example:
    select location,file_name into loc_in,file_in from temp_tbl;
    p_File_handle := utl_file.fopen (loc_in, file_in, 'W');
    My co worker is suggesting that getting the variable values from the table is not a good practice. He suggests that the values should be hard-coded in the program. Now you might ask what would happen if the file name or directory changes. His suggestion is to have a build file and do a token substitution of those hard coded values in the program and then load in to the DB. In short the process will involve the following steps:
    -Get the package from the repostory.
    -Change the file name and directory in the token file.
    -Run the build process that will replace the values in the package .
    -Load the new file (with the updated values) in to the DB.
    Example:
    This way the program will be initially coded like this:
    p_File_handle := utl_file.fopen ('${loc_in}', '${file_in}', 'W');
    After the build file runs, it will replace the values as
    p_File_handle := utl_file.fopen ('C:/test', 'testfile.dat', 'W');
    Once the file has changed with the new updated values, compile that into the database.
    Ideas/comments?

    Re: Best way to deal with hard coded variables in a package: why have you reposted using a new profile?
    Neither post provides enough clear information on what the actual requirement is. We need more data in order to comment on your idea, your co-worker's, or to suggest alternatives.
    My co worker is suggesting that getting the variable
    values from the table is not a good practice.His reasons for this are...?
    "variable values": Why do they vary? How often do they change?
    The file names and the directories are retrieved from
    a database table.How do the values get into the table? What is the volume of the data?
    Oracle version? Operating system?

  • What is the best way to import a full database?

    Hello,
    Can anyone tell me, what is the best way to import a full database called test, into an existing database called DEV1?
    when import into an existing database do you have drop the users say pinfo, tinfo schemas are there. do i have drop these and recreate or how it will work, when you impport full database?
    Could you please give step by step instructions....
    Thanks a lot...

    Nayab,
    http://youngcow.net/doc/oracle10g/backup.102/b14191/rcmdupdb005.htmA suggestion that please don't use external sites which host oracle docs since there can not be any assurance that whether they update their content with the latest corrections or not. You can see the updated part no in the actual doc site from oracle,
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#i1009381
    Aman....

  • What is the best way to work with Word documents in The InDesign CS4???

    I work in Microsoft Word 2007 and all my documents have *.doc format.
    What is the best way to work with Word documents in InDesign CS4???
    David Blatner says to avoid copying and pasting text from Word instead of placing it (Ctrl+D).
    How about pasting RTF or Text Document???
    I want to make book's layout in ID CS4 and its main feature is that there is the left page with text and the right - with graphics.
    So, as I understand to place the text on each page I must create for example 70 Word documents and place each item on 70 left pages???
    It loks like wasting time. I sthere another way of making such layout???  What kind????

    It's best to place any text.
    You can have all of your text in one file and use auto-flow to add threaded text frames and pages as required (Hold down the Shift key when you click the loaded text cursor), but it's a little non-standard to have the thread only on one side of the spread from the auto-flow perspective, so you'll have to set up properly.
    This is one case where a master text frame will work to your advantage. On your master page spread, add a text frame to the left page, but not to the right (or at least not threaded to one on the right -- for some other project you might actually want two independent text threads). Hold the loaded cursor over a frame on the left side of a document page and auto-flow. ID will add new spreads as necessary, but only put the text on the left side.
    Peter

  • How is the best way to deal with duplicate photos

    I am using a new retina 27" iMac 16gb ram OS X 10.10.1
    Aperture 3.6
    What is the best way to deal with duplicates that get in Aperture Vaults
    I have used Gemini and it finds duplicates, but I have no way of telling if the original are still there.
    I don't want to go through 15000 photos to try to find the duplicate.
    Thanks Charlie

    You mean - one image in a vault, one in a library?  Or duplicates in the same library?
    Photo Sweeper can scan several libraries or folders at the same time and display the duplicates side by side to let you pick which to keep.  You can define rules to mark photos for automatic deletion as well.
    http://overmacs.com/photosweeper.html

  • Best way to deal with Mutating table exception with Row Level Triggers

    Hello,
    It seems to be that the best way to deal with Mutating Table exception(s) is to have to put all the trigger code in a package & use it in conjunction with a Statement level trigger .
    This sounds quite cumbersome to me . I wonder is there any alternative to dealing with Mutating table exceptions ?
    With Regards

    AskTom has a good article about this,
    http://asktom.oracle.com/tkyte/Mutate/index.html

  • What is the best way to deal with memory leak issue in sql server 2008 R2

    What is the best way to deal with memory leak issue in sql server 2008 R2.

    What is the best way to deal with memory leak issue in sql server 2008 R2.
    I have heard of memory leak in OS that too because of some external application or rouge drivers SQL server 2008 R2 if patched to latest SP and CU ( may be if required) does not leaks memory.
    Are you in opinion that since SQL is taking lot of memory and then not releasing it is a memory leak.If so this is not a memory leak but default behavior .You need to set proper value for max server memory in sp_configure to limit buffer pool usage.However
    sql can take more memory from outside buffer pool if linked server ,CLR,extended stored procs XML are heavily utilized
    Any specific issue you are facing
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • What is the best way to work with AVCHD 720 24p footage in FCE4.1?

    Hi I have a Panasonic HMC-150 and I've been shooting 720 24p footage at 21 mbps transfer rate.
    I was wondering what is the best way to work with this material in FCE 4.1? I see that in the easy set up menu they only have the option of 1440X1080i at 50 or 60 fps or 1920X1080i at 50 or 60 fps.
    Also in the rates drop down menu there is only 50 or 29.97.
    So I was wondering which is the best choice for 720 24p footage and will it look alright in any of them? Also is it possible to customize these settings?
    And finally can you work with faster transfer rates (21mbps) in FCE?

    Yikes, this is going to be tricky since FCE does not support native 24p editing.
    The work around for some of us is that AVCHD material that is 24p is often recorded to disc at 60i using telecine, in which case it can be editing at 29.97 frames per second, and then detelecined afterward for final export at 23.98 fps. The problem is that I think your camera actually records real 24p - not 24p packed into 60i. When you import the material from the camera what does QuickTime report the framerate as?

  • What is the best way to work with mixed media in 1080 timeline?

    Hi there,
    I have a project shot mostly in 1080 24p but a bit of 720 24p and 4x3 30p footage.
    What is the best way to work with this mixed media?
    Thanks!
    Steven

    Hi Shane,
    Ok just to recap (thanks for being patient by the way)...I have put some questions in here...feel free to write in caps to respond and we'll put this baby to rest!
    1) I will work in a 1080p FCP sequence, correct?
    2) HD 1080p footage captured as applepro res hq I will leave as is and work with?
    3) HD 720p footage which was captured as applepro res hq. Can I just drop in 1080 timeline and let FCP do its work? Or should i run through compressor, if so what setting shall I submit it too?
    4) I dont have a budget for an external hardware to convert SD to HD...should I capture my SD Beta through Final Cut and just leave and let FCP do its work? Or should I run through compressor? If so what setting shall I submit it too?
    5) For for my master sequence in FCP am I not using an I-Frame format apple pro res if I am using my apple pro res hq 1080 footage as my formatted sequence? I am not sure what you mean by GOP?
    6) I also found some 60p footage 1080p XDCAM compressor shot with the same XDCAM camera. I put in the 1080p 24p timeline but it was pretty choppy...any ideas of this conform?
    Thanks very much for all your help it has gone along way,
    Steven
    Saying what CODECS you are working with was my question. 1080, 720, 4:3...really says nothing. There are a dozen 1080 codecs, another dozen 720 codecs, and nearly 100 4:3 formats.
    Best to capture all the footage to one uniform codec.
    Second best is to work with one format and let FCP conform the rest to that...IF and only IF that format is an I-Frame format like ProRes. GOP formats as master sequence formats cause TONS of issues.
    What I'd do is work 1080 ProRes, just add the 720p footage (Use Compressor to convert it if you didn't have a lot, but if you had a lot, just add it), but I'd capture all the SD 4:3 footage via a Kona 3 or Matrox MXO2 as 1080 ProRes. Hardware conversion of SD to HD is much better than anything FCP can do. AE might do good as well. But then use Compressor to convert 29.97 footage captured (you can't convert 29.97 to 23.98 when you capture) to get to 23.98.

  • How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.

    How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.  i really just want my money back.  Very disappointed.  Also disappointed that it is so hard to find a way to communicate with Adobe that I have to resort to asking this question in this forum. 

    You need to use the CHAT link in support to reach Adobe staff. Be sure you know the product name you are trying to cancel, Adobe have lots of products, several converters etc. I think it is ExportPDF you have, most likely.

Maybe you are looking for