CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 1999
    Posts
    2

    JDBC and Apllet problems





    Hi,

    I've created an applet which connects to a remote database and accesses data from

    the database. This program works properly in the Applet Viewer, but not in the browser (either Netscape of IE3) and instead shows the Security Exception.

  2. #2
    Join Date
    Mar 1999
    Posts
    19

    Re: JDBC and Apllet problems



    Hi binu

    Let us discuss ur problem in detail.

    First of all let me know the Architecture u are using for the project.

    If it is 2-tier or 3-tier



    First : 2-tier

    If ur database is on the same m/c then for Netscape , U open ur

    hhtml file from "File" menu & "Open -Page" option .

    otherwise

    try

    http://file:///C|/directoryname/jdbcappletname.html


    Actually ur q-details are very less . pl describe it more. I will

    try to ans. my best.

    Provide details like

    Java version

    Jdbc driver type

    2/3 Tier

    etc.





  3. #3
    Join Date
    Mar 1999
    Posts
    2

    Re: JDBC and Apllet problems



    Hai Sunil,

    1). My data base is on a remote m/c

    2). I am using Oracle Driver

    3).Version of Java is 1.1 (JDK1.1)

    4). Architecture is 2 Tier


    My prog is working perfectly for data base on same m/c .More specificly , I created

    a data base in msaccess on my harddisk and set 32bit ODBC .Then using JDBCODBC

    driver i was able to access the data.I would like to know how to access the remote data base.

    The problen is when i try to connect a remte data base created in oracle,the browse is

    showing securityexception .The program(remote) is working perfectly working on appletviewer.

    I think my Question is clear now.

    Bye.







  4. #4
    Join Date
    Apr 1999
    Posts
    3

    Re: JDBC and Apllet problems



    Hi !


    I haven't yet worked with JDBC, but as I had some Problems executing my applets in a browser I suppose you should have a look, if your browsers work with jdk 1.1 ...

    In my opinion IE3 does not support the jdk1.1 ! But I'm not sure about this. (Have a look at the java console of IE3 and you'll know it)

    You may try IE4 or even better IE5 and Netscape 4.05 or higher !

    If this doesn't work or you already checked this out I'm sorry.


    der Stefan.

  5. #5
    Join Date
    Apr 1999
    Posts
    10

    Re: JDBC and Apllet problems



    The problem is clear.

    This is a security concern, and comes from a design decision of Sun.

    Here is an extract from Sun's FAQ on JDBC:

    "Use of the JDBC-ODBC bridge from an untrusted applet running

    in a browser, such as Netscape Navigator, isn't allowed. The

    JDBC-ODBC bridge doesn't allow untrusted code to call it for

    security reasons.

    [...]

    ODBC is native code, so once ODBC is called, Java can't guarantee

    that a security violation won't occur.

    [...] it is possible to use the JDBC-ODBC bridge with applets that

    will be run in appletviewer since appletviewer assumes that applets

    are trusted."


    JDBC FAQ

  6. #6
    Join Date
    Mar 1999
    Posts
    19

    Re: JDBC and Apllet problems



    Hi binu

    I agree with Paolo Milani .

    I think ur problem is solved.



    But there is solution for 2-tier architecture using applet

    You implement Type-4 driver for database connection. Now ur

    database will reside on the same m/c where web server is installed



    here is url to know more about type -4 drivers


    http://splash.javasoft.com/jdbc/jdbc.drivers.html


    Best wishes

    sunil



  7. #7
    Join Date
    Mar 1999
    Posts
    5

    Re: JDBC and Apllet problems



    dear binu,

    see first of all the jdbc odbc driver uses native calls so U must first set

    the security option in Ur browser as false

    edit the pref file (in netscape directory) to add line local classes security = false

    this will help U to run the jdbc application on Ur pc only

    but if u want to run this application on every pc without installing jdbc odbc driver installed

    try some third party java based drivers like IDS Server. this is a database server

    which along with a HTTP server(sambar server) sit on one machine and connect all the application

    to the database from there

    only thing U have to do is to connect to that server

    I hope U will think on these lines

    bye

    Abhisheik r Vishwakarma



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured