J2ME and PHP DATABASE CONNECTION

Hi ALL
I am writing an application that need to pull information from a database. I have a Tomcat server set up. I am using MySQL as my database. I was planning to use PHP to pull information from the database. I just do not know to use J2ME with PHP. In other words once I pull the desired information from the database how do would I then display it using J2ME. Does any one have any good books or web references, where I can begin to start looking.
Thanks for your help

I have created a solution with the exact configuration you describe (www.i2score.com in swedish). You dont have to use J2ME with PHP. They work independetly from each other. My J2ME Midlet serialize and de-serializ the information, communicate via HTTP to the Java servlets running on the Tomcat server. The servlets put and get info from the MySQL database.
On the same server (could be a seperate if you want) PHP pages with MySQL coupling is used for web access to information on the same database but put and get. Very neat in my opinion. Good luck with your project. Be more precise with your roblems if you want more help.

Similar Messages

  • MySQL + apache2 + PHP Database connection error

    Hi Folks:
    I am trying to connect to the database and keep getting a 500
    internal server error. here is the setup
    Database server -- mysql 4.1 (linux) on a gentoo linux server
    -- IP 192.168.0.10 -- srvdb-01
    Webserver - Apache2 + PHP 5 on Gentoo Linux server
    192.168.0.29 - srvweb-03
    I have all the connections ready to go, dav is moving files
    etc, but when i try to create a database connection, i keep getting
    the following error
    > PROPFIND /_mmServerScripts HTTP/1.1
    > Authorization: Basic dGhvbG1lczp0eXBob29u
    > User-Agent: Contribute/3.0
    > Host: inventory.mcaschool.net
    > Pragma: no-cache
    > Accept: image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg, */*
    > MIME-Version: 1.0
    > Content-Type: text/xml
    > Content-Length: 134
    > Depth: 0
    > Connection: Keep-Alive
    < HTTP/1.1 500 Internal Server Error
    < Date: Tue, 25 Apr 2006 21:09:54 GMT
    < Server: Apache
    < Content-Length: 607
    < Connection: close
    < Content-Type: text/html; charset=iso-8859-1
    (copied from the DW8 FTP LOG)
    I am really baffled by this problem -- can someone please
    point me in the direction of a solution?
    thanks
    Tim Holmes
    IT MANAGER - Medina Christian Academy

    DJtonyF wrote:
    > ... the issue isnt with godaddy.com the issue is with
    dreamweaver. the "localhost" connection i attemped to connect to
    was one on my own server i setup on my computer.
    How have you set up your Testing Server in the site
    definition?
    If your server root is C:\htdocs, and your site is in
    C:\htdocs\mysite,
    that's the value for "Testing server folder". The URL prefix
    should be
    http://localhost/mysite/.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP Database Connection Error

    im attempting to a connect to a sql database using php. when
    i create a new connection Dreamweaver always gives me an
    "unexpected error" so it connot connect. the database is mysql 4.1
    (on godaddy.com) and php 5 on the server.
    i attemped to change it to "localhost" on my computer
    thinking it was a godaddy problem but the same issue acures. Im not
    sure what to do

    DJtonyF wrote:
    > ... the issue isnt with godaddy.com the issue is with
    dreamweaver. the "localhost" connection i attemped to connect to
    was one on my own server i setup on my computer.
    How have you set up your Testing Server in the site
    definition?
    If your server root is C:\htdocs, and your site is in
    C:\htdocs\mysite,
    that's the value for "Testing server folder". The URL prefix
    should be
    http://localhost/mysite/.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP database connection strategy

    Hello everyone,
    I'm currently writing a website with PHP and MySQL.
    I would like to know which strategy you choose to manage database connection.
    I did not find any way to have a database connection pooling in PHP like I usally use in J2EE.
    My current strategy is some kind of singleton my front controller will share with all "sub controller".
    So, to render a page, I'll have a single static connection ( using PDO ). Opened at the beginning and closed at the end of the page.
    So, what do you use in your PHP webapps?
    Regards.

    zenlord wrote:
    litemotiv wrote:Open just on the start of the page though, collect all data in an object, close the connection and then print out.
    Care to give me an example, or point me to an online example of this?
    I'm merely an amateur, and don't understand things like 'singletons' - I do think that I currently code in MVC, but I would like to know more about design patterns. When it comes to db-connections, I think I open the connection, load all the needed data and close the connection. Don't know whether I 'collect the data in an object', though
    If you search a very good book, my suggestion is:
    http://www.amazon.com/Objects-Patterns- … 982&sr=8-1
    Seriouly, a must have!
    litemotiv wrote:Open just on the start of the page though, collect all data in an object, close the connection and then print out.
    Great to see I'm not completely wrong
    Nagian wrote:but have you already read the Zend Framework Quickstart?
    Yep, I know Zend. But I want to create something without any framework to learn and improve my php knowledge.

  • Open and close database connection jsp page

    hi there, i wanna know about how to open database connection to Mysql at the beginning of the page and close the connection at the end of the page. The jsp page contain all processing code.
    plz help me...thx thx

    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <%@ page language="java" import="java.sql.*" %>
    <%!
    // define variables
    String id;
    String firstName;
    String lastName;
    // define database parameters, change this according to your needs
    String host="localhost";
    String user="root";
    String pass="";
    String db="test";
    String conn;
    %>
    <table border="1" cellspacing="1" cellpadding="5">
    <tr>
    <td><b>id</b></td>
    <td><b>first name</b></td>
    <td><b>last name</b></td>
    </tr>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user 
    + "&password=" + pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    // change this query according to your needs
    String Query = "SELECT id, firstname, lastname FROM abook";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
    while(SQLResult.next())
       id = SQLResult.getString("id");
       firstName = SQLResult.getString("firstname");
       lastName = SQLResult.getString("lastname");
            out.println("<tr><td>" + id + "</td><td>" + 
         firstName + "</td><td>" + lastName + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </table>
    </body>
    </html>hi :-)
    i've got that on the net as part of the tutorial on jsp (long long time ago)
    you just have to be resourceful in finding solutions :-)
    try google :-) there are lot's of tutorial available in there ;-)
    goodluck ;-)
    regards,

  • When to open and close database connection

    im trying to connect to a oracle database using servlets
    when should i open and close the connection
    it works fine when i do both in the doPost() method
    but when i tried to open connection in init() methd .. it doesnt seem to work
    what should i do...
    the connection is initialised in the init() method but is null in the doPost() method

    " im trying to connect to a oracle database using servlets
    when should i open and close the connection
    it works fine when i do both in the doPost() method
    but when i tried to open connection in init() methd .. it doesnt seem to work
    what should i do...
    the connection is initialised in the init() method but is null in the doPost() method"
    1:
    without seeing the code i would say the the connection is null
    because you are storing it as a servlet class variable which is
    not thread safe.
    2:
    The best way to do it using connection pooling
    detailed docs on the tomcat website
    3:
    if you are not using connection pooling, then
    open and close the connection in the do* method
    or
    use init() to place the connection in the servletconfig
    and close in destroy() and use synching to access

  • Production and Development Database Connections

    Within JDeveloper I have created a database connection to a DEVELOPMENT database and am exposing PL/SQL packages in the development database as web services.
    I can develop and test successfully the exposed packages as web services, and can deploy and run them to a standalone OC4J container on my local machine.
    I then handover the generated EAR file to the production team who deploy the EAR as a web service to the Oc4j container in a remote 9i Application Server.
    This runs successfully from 9iAS.
    So far so good.
    If I have the same PL/SQL package in a live database and development database, but only have access to the development database, how can I expose the package in the live database?
    Can I have a database connection in JDeveloper with a connection name pointing to the development database connection, and have a connection defined in 9iAS with the same name pointing to the live database?
    Any information will be useful.
    Thanks,
    Claire.

    Per the J2EE "roles" definition this is a deployment role todo.
    I.E. the theory is; take a 3rd party ear, depoyee with your appserver vendor's
    deployment tool, edit the data-sources.xml imbeded in the ear on the fly, as
    deployment happens.
    Bake to reality-
    OC4J 903 is intended to be used with OEM for the J2EE spec'ed role of deployer. I'm
    headed this way, but not started the 903/OEM todo.
    Today, OC4J 902 and 902 Jdev, I deploy to a local instance of OC4J. I take that
    ear to production. I've written procedural instructions on poping open the ear and
    editing the data-sources.xml for the DB connection URL and possible login/passwords.
    BTW all your AppModule configurations will have to use data-sources DB connections else
    you'll have DB connection info littered in your bc4j.xcfg's for each AM deeper in your war's.
    I'd like to hear how this is supposed to work from some other folks? :)
    Good luck,
    curt

  • Servlets and Persistent Database Connections

    I'm looking at building an application using
    java Servlets.
    My Application will consist of many individual Java Servlets.
    I want to ensure that there is a persistent database connection so that the users do not have to log on again when a page generated via Servlet1 contains a URL to Servlet2....
    null

    Look at the Http session class in the Servlet specification. It will maintain state for you across client requests.

  • Server 10.3.9 - MySQL Upgraded and PHP cannot connect to it.

    Hi all.
    I have a Clean 10.3.9 Build after it crashed I needed to recover it. I would like to use this to host a CMS called MODx but it required MySQL 4.1 and 10.3 ships with 4.0.
    So I downloaded the latest installer for MySQL of the website along with the Administration tool and have MySQL 4.1 running happily on the server now.
    I have my website configured to use PHP and it loads the pages perfectly - I just enabled PHP in the Apache Module of Server Admin. However it does not connect to the database and everything I have seen so far points to the link in PHP pointing to the bundled MySQL installation rather then an addition.
    What do I need to update this configuration - no changes to php had been made it was using the defaults. I did a brief search on the net in the time available - but everything refers to 10.4 - which if we were running it I would not have needed to upgrade - but not to 10.3.

    Like Dan White, I have found that I can still run the Lide 90 under Mavericks. As Dan says, the buttons on the front of the scanner don't work but I rarely if ever used them.
    I have just tested the scanner using Acrobat Pro and it loads up the Scangear software to capture the scan, with no problems at all. I didn't have to reinstall anything as it was all there already and working in Mountain Lion. Photoshop CS 5.1 is different; it does not recognise the scanner, presumably because it can't find a TWAIN driver for it. Image Capture does not recognise the scanner either, but I don't have the latest (10.8) Canon MP Explorer and Explorer Opener software installed.

  • Crystal Reports and Access database connection error

    I had this in a different forum with no hits, so I am trying this one.
    A person that I work with has multiple reports set up that pulls from an Access database that is password protected. When we moved everything over to a new computer, those reports now say that it cannot access the fields inside the database. It never pops up with a login screen either, like it does on the old computer. I played around with the ODBC, with no luck, couldn't get anything to work. I have also tryed relinking the database, but I keep getting connection problems. We are on a network, so her settings should have all moved with the new computer. Along with the database and the reports being on the server, so they were never moved. I am thinking it has something to do with a system file.
    I also found this document on this site, but cannot find the download it mentions, sounds similar to my problem.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208b8fe5-681e-2b10-d2bb-b201f266d0ab
    Does anybody know how to fix this without the utility mentioned in the above link, or know where I can get the utility??
    We are using Access 2007 and Crystal Reports 7.  The database is not save as an Access 2007 database, but a regular mdb.
    Please Help!

    Post Author: ejthunder
    CA Forum: Crystal Reports
    Hello Chris,
    Crystal Reports does not store the database password with the RPT file.  This is by design (Crystal is not a database security product).  This is true of all versions of Crystal Reports.
    If your users need to see fresh data when opening the reports then they will have to log in by providing at least the password.
    You can send reports with Saved Data that won't try to hit the database, but the data won't refresh either.  To save data with the report go to the File menu and click next to Save Data with Report.  Refresh the report and then save it.  The report will now have saved data and won't try to hit the database when opened.  If the user hits the refresh button then they will get prompted to log into the database.
    I hope this helps.
    EJ

  • Weblogic and lost database connection

    Good Morning,
    I'm working with Weblogic, connecting to an Oracle database on a rather unstable network. From time to time, the connection to the database is lost, and at the moment, this means having to restart weblogic.
    Is there any way to configure weblogic to automatically reconnect to a database if the connection is lost and then restoired?
    Thanks in advance for your help.

    this forum is about Sun's J2EE sdk/application server.

  • How to keep the worksheet and the database connection in sync

    Is there a way I can configure sqldeveloper to do this
    - I click on a worksheet
    - The specific connection in the "connections list" on the left get highlighted
    - The specific connection if not expanded gets expanded
    Basically I want the sql worksheet and its connection to be always in sync
    I am using sqldeveloper Version 2.1.0.63 Build MAIN-63.41 on Windows XP
    -Nags

    No, but it'd be nice. I recommend adding it as a feature request @ http://sqldeveloper.oracle.com and have people vote on it. It

  • Lan Database and Wireless Database Connectivity and Settings

    Some one help me that what the difference in LAN connectivity and connectivity over a wireless network.
    Is any difference. If difference than please send me some material to understand this.
    Thanks

    From the Oracle perspective, there is no difference where the communication comes from, as long as access through a supported protocol is established. So, from this perspective, all rules that apply to regular connectivity applies to wireless.

  • How to use sql request with Jdev and database connection

    Hello,
    I have a login page with simple username and password inputsecret text and a button validate! I would like, when the user click on the validate button, to check in the database that the user and password matches. I've done the "Method BIndind..." with the commandButton_action and the database connection works fine.
    How can I use an already existing procedure, say authenticate, wich is stored in the database to authenticate my user ?
    Do I have to create a jdbc connection in java even if I've done the connection with the "create new database connection" wizard ?
    String s1 = "jdbc:oracle:thin:@address:1521:ORCL";
    System.out.println( "Connecting with: " );
    System.out.println( s1 );
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    this.conn = DriverManager.getConnection( s1,"user","pass");
    thanks for your help

    Creating a connection to the DB in JDeveloper doesn't mean that your application is now connected to the DB - so yes you do need to create a connection to the database using JDBC.
    One note - if you are trying to do a database user authentication the following is probably the better way to go about it:
    http://www.oracle.com/technology/products/jdev/howtos/1013/oc4jjaas/oc4j_jaas_login_module.htm

  • OLE Objects and Database Connectivity Toolkit

    I am trying to insert and image (jpg) that is created in Labview into an Access database as an OLE object. How do I go about making this conversion, or are there any other suggestions?

    Hello -
    Have you tried any of the shipping examples for the database connectivity tookit? You can find them by navigating Help >> Find Examples >> Toolsets and Modules >> Database Connectivity. The Insert Example.vi may help you get started. Click here to access database examples posted on the Developer Zone.
    Please let me know if any of these examples helped. If not, can you provide more information about the version of LabVIEW and Access you are using? Thanks! Have a great day!
    Becky B.
    Applications Engineer
    National Instruments
    Becky Linton
    National Instruments
    Field Engineer
    Office: 734-464-2463
    Cell: 248-709-2822
    Email: [email protected]

Maybe you are looking for

  • IDLE event problem with newer versions of the flash player

    Greetings, I have an issue that seems to be related to newer versions of the flashplayer in how they handle IDLE events. I have an IDLE event handler that works as expected with flashplayer version 10.0.45.2. With flashplayer 10.2.153.1, the IDLE eve

  • Again imac 309rs/a fan noise

    Hello! problem with fans again After hanging my imac - fan began to publish a crackling sound. that this could be? few image's of istat here look's like all right and here: imac didnt hanging again, but noise crash my mind so what i try to do: reset

  • I want to know whats the table according to this requirement

    .   Pending Purchase Order Requirement Specification:   1.     Fields on selection screen (input screen) : Vendor Code From to , Period From to , Material Code from to. 2.     Field in the output List : P.O. No, PO Date , Vendor Name , Vendor code, M

  • What the best way to call twenty tuxedo domains from one weblogic server use WTC

    I need to call twenty tuxedo domains from one weblogic server use WTC. the Service be called in the twenty tuxdo domains are same, do I need to write twenty EJB in the weblogic server to call the same service? who have good adea to deal with this pro

  • ALV with user-defined buttons on toolbar in wd abap

    Hi All, I have to create an alv with user defined buttons  in wd abap on its toolbar.Could any one tell me in detail about it or provide me with any tutorial based on it. Thanking you all in advance.