Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    89
    Thanks
    3
    Thanked 0 Times in 0 Posts

    JDBC and PHP. How to connect, and are there limitations?

    Hi there,

    At present, our I.T. department are exploring different methods of connecting to our IDMS database via the internet.

    We have realised that we could use an alternative to ODBC drivers to connect to our IDMS database. The alternative is JDBC Type 4 drivers. If we have to use ODBC drivers, it means we are going to have to set up a lot of new software on our mainframe which will be a lengthy process.

    If we use JDBC, we may be able to establish a connection with our IDMS database a lot sooner than if we were to use ODBC. It all depends upon the pros and cons of both ODBC and JDBC.

    So, can JDBC be connected to through PHP, ASP, etc.........or does it have to be connected to via JSP and Java? Will using JDBC limit which scripting technologies we can use? If connecting to JDBC via PHP, ASP etc is possible, is it a tricky process? Or is it relatively straight forward? What does it involve?

    Will using JDBC limit what kind of applications we can build? Or is it just as flexible as ODBC?

    We don't want rush ahead and implement the use of JDBC without checking with first. Even though it may be quicker to set up JDBC initially, there may be complications that pop-up further down the line that some of you may be aware of?

    Also, the way that we set up the connection to our database mentions these 3 possible routes:

    1) TCP/IP connects to the Type 4 JDBC driver, which resides on the Java Platform.
    2) Type 4 JDBC driver connects to a servlet, which connects to web server (these also reside on the Java Platform)
    3) The web server then connects to an applet on the browser client.

    When it says any Java Platform, does this mean Windows, Linux etc? And then where it says it connects to an applet on the browser client, does that mean it connects to the internet browser? I am a little confused.

    Another route is as follows:

    1) TCP/IP connects to the Type 4 JDBC driver, which resides on the Java Client.
    2) The Type 4 JDBC driver then connects directly to the applet, which also resides on the Java Client.

    What is a Java Client?

    The final route is using JDBC type 3 drivers. It says that to use these drivers, we must have a JDBC Server which is located on the Java Platform. It connects this way:

    1) TCP/IP connects to the JDBC server, which resides on the Java Platform.
    2) The JDBC server connects to the Type 3 JDBC driver, which resides on the browser client.
    3) The type 3 ODBC driver then connects to an applet on the browser client.

    I am so stumped by all this. Can anyone help clarify all this for me???

    Any advice on this subject would be great.

    Thank you.

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    865
    Thanks
    7
    Thanked 29 Times in 28 Posts
    Quote Originally Posted by jpmad4it View Post

    So, can JDBC be connected to through PHP, ASP, etc.........or does it have to be connected to via JSP and Java? Will using JDBC limit which scripting technologies we can use? If connecting to JDBC via PHP, ASP etc is possible, is it a tricky process? Or is it relatively straight forward? What does it involve?

    Will using JDBC limit what kind of applications we can build? Or is it just as flexible as ODBC?
    JDBC can only be used with Java applications and therefore, no....you cannot expect PHP, ASP...etc. to work with JDBC. There may be ways where you are able to create a java application that is built as a proxy between an ASP.NET, or a PHP application and your database...but that is way too complex.

    Quote Originally Posted by jpmad4it View Post
    When it says any Java Platform, does this mean Windows, Linux etc? And then where it says it connects to an applet on the browser client, does that mean it connects to the internet browser? I am a little confused.
    It means any operating systems that supports Java Virtual Machine or JVM for short. Most modern operating systems support Java, including Linux, Unix, Mac OS, Windows...etc. As for connecting to the database through an Applet on client's browsers...I think you need to understand what applets are and how they work...please see this page http://en.wikipedia.org/wiki/Applet

    Quote Originally Posted by jpmad4it View Post
    What is a Java Client?
    When working with databases, a client server model is usually used to communicate back and forth with the application. A java client...is usually the interface that you build which your application users will be using to interact with the database (Server). For more info, see http://en.wikipedia.org/wiki/Client-server

    As for connecting to the database and the various options or routes as you put it...please read this page from wikipedia http://en.wikipedia.org/wiki/Java_Database_Connectivity

    Sun has a number of tutorials on JDBC and it is highly recommended that you read their documentations before making a decision. See java.sun.com/docs/books/tutorial/jdbc/index.html

    Cheers
    ~E
    Last edited by ess; 07-24-2008 at 10:49 AM.

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    89
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hey thanks for that. Much appreciated.

    I've read a few articles about bridging Java and PHP.....is this not the same concept? You can call Java classes from within PHP. So if you connect to the database within Java, and then call that class......would that work??

  • #4
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts
    in *theory* it could be done with PHP, HOWEVER it is a bit useless....it still requires JAVA to help it out. set up a php page that can modify your_applet.php then have the applet accept the data as parameters, cron job the applet(is that possible though? as I am going on theory so I do not know this would work) every 5 min run applet if there has been updates in unrun queries... THIS WOULD BE VERY INSECURE THOUGH its just the theory that counts

  • #5
    New Coder
    Join Date
    Jan 2006
    Posts
    89
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Cant have insecurities! Thanks anyway!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •