JDBC and Applets

I'm trying to view results of a query in an applet.
Keep getting the error
ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
I know there is security issues. can i get around them???
This application runs perfect in a driver program...
can anyone help??????
Thanks

I set the policy tool but it still returning "ClassNotFoundException"
Could you check my code to see if there is anything wrong???
     String url = "jdbc:odbc:timetable";
     String query = "select Day, Room from Thirdyear";
     try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
     } catch(Exception ex) {
     text.appendText("My Error: \n" + ex);
text.appendText("\n" + ex);
System.out.println(ex);
     // return;
     try {
     Connection con = DriverManager.getConnection(url, "", "");
     Statement stmt = con.createStatement();
     ResultSet rs = stmt.executeQuery(query);

Similar Messages

  • Cann't access oracle 9i with thin jdbc and applet

    Hi..
    I write thin jdbc applet and application programs..
    application programs works well..
    but applet cann't connect...
    error messages below..
    access denied (java.util.PropertyPermission oracle.jserver.version read)
    web server and dbms server are on same machine...
    applet programs is in the demo applet program of oracle's installation folders...
    I hope your comment...
    thanks..

    Hi Hyun,
    This is basically just a guess -- since you didn't provide a lot of information (in my opinion) -- but I assume that "oracle.jserver.version" is some "System" property.
    Due to the security restrictions placed on an applet (and which aren't imposed on an application), an applet cannot access all of the "System" properties -- only some of them (like "java.version", for example). So that's why (I think) your application works, but your applet doesn't.
    There are several workarounds for overcoming an applet's security restrictions -- the most popular (as far as I know) is to "sign" your applet. There are many Internet resources available that explain how to "sign" an applet -- a simple Internet search will be more than enough to get you going (if that's at all relevant to your situation).
    Hope this has helped you.
    Good Luck,
    Avi.

  • Policies, JDBC and applets

    I have looked all over the WWW for info on this and have found loads of questions but not one clear cut answer. It's amazing the number of "OK, thanks, I got it working" without saying how. Here is my problem. I have a JDBC applet, running on IE. If I run it locally it works like a champ. If I run it through "localhost:xxx.html I get that infamous "Unable to connect to MySQL on localhost:3306, are you sure it's running..Java.security.accesscontrol exception. One problem mentioned setting a policy..didn't mention which one though. So I set socket connection priv on localhost:3306 as that was explicitly mentioned in the exception. Seemed like a good idea. It was but still did not solve the problem. So what I think would be really swell is if in one place there was a really good answer on how to set up an applet using JDBC under IE to work with respect to the security manager. Could someone please help?
    Thanks in Advance,
    Walt

    Hi,
    Let's first c an example of the intended functions of the two methods.
    We have an HTML-type document, "document.html" at:
    host_name/some_directory/document.html
    and we have our applet, "OurApplet.class" at:
    host_name/some_directory/applets/OurApplet.class
    In the "document.html", we have embedded "OurApplet.class" inside. Then getDocumentBase().toString() should supposedly be:
    host_name/some_directory/document.html
    and getCodeBase().toString() should supposedly be:
    host_name/some_directory/applets/OurApplet.class
    If the directories containing the HTML document and the applet were the same, both methods would give the same thing; if they r not, it'd be like the above.
    Ok, the above is the way they'r intended to be. According to the bug ChuckBing has shown us (actually the methods r under the class java.applet.Applet instead of under the package java.applet), the two methods however produce what their counterpart friends is supposed to produce. So if your version of SDK/JRE produces the bugged version of the output, u can replace the method with its counterpart friend. However, keep in mind of the target JRE the applet will be run on and the possibility of more than one potential audience JREs.

  • Jdbc and applet

    I have Jdbc code which is running fine as a stand alone program. When i integrated it with an apllet it gives me
    access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    I m using netbeans. 3.6 The intersting thing is the code runs when I debug it But gives the above error when i execute it. I hope some one can help me out. It is urgent

    You should urgently read this:
    http://java.sun.com/docs/books/tutorial/applet/overview/security.html

  • JDBC and Applet communication

    HI!
    I am not able to connect my Oracle datbase in Applet.
    Please give ur suggestions.
    Thanx in Adv
    Vink

    Hi
    An applet can request a socket connection only to the server from which it is downloaded from.
    If your database and the webserver are running on different hosts then the applet security model restricts the applet from connecting to the database. You need to set the proper security policies and sign the applets.
    Refer the following link on applets
    http://developer.java.sun.com/developer/technicalArticles/Security/Signed/
    Also post the complete error/stack traces if you get into some problems.
    Hope this helps
    shrini

  • Problem with Using JDBC in Applet

    Hi,
    i have written an applet to log in (it checks the database, if the username and pasword exists it shows corresponding message). i use access or sql server and applet is started but no message is shown(i think it does not connect to database). here is my code:
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    import java.awt.*;
    public class appletDatabase extends JApplet implements ActionListener {
    JLabel l1;
    JLabel l2;
    JLabel l3;
    JTextField tf1;
    JPasswordField tf2;
    JButton btn;
    Connection cn;
    Statement st;
    String hostname;
    public void init() {
    hostname = "localhost";
    l1 = new JLabel("User Name: ");
    l2 = new JLabel(" Password: ");
    l3 = new JLabel(" ");
    tf1 = new JTextField(20);
    tf2 = new JPasswordField(20);
    btn = new JButton("Sign in");
    Container c = getContentPane();
    c.setLayout(new FlowLayout(FlowLayout.LEFT));
    c.add(l1);
    c.add(tf1);
    c.add(l2);
    c.add(tf2);
    c.add(btn);
    c.add(l3);
    btn.addActionListener(this);
    setSize(300,300);
    setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource()==btn) {
    boolean b = check(tf1.getText(),new String(tf2.getPassword()));
    if (b) {
    l3.setForeground(Color.green);
    l3.setText("Username and password exists. ");
    else {
    l3.setForeground(Color.red);
    l3.setText("Username and/or password does not exist.");
    public boolean check(String un, String pass) {
    String query="SELECT * FROM Table1 WHERE username LIKE'"+un+"'" +
    " AND password LIKE'"+pass+"'";
    boolean b = false;
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    cn = DriverManager.getConnection("jdbc:odbc:login");
    st = cn.createStatement();
    ResultSet rs = st.executeQuery(query);
    if (!(rs==null))
    if (rs.next())
    b = true;
    rs.close();
    st.close();
    cn.close();
    } catch (SQLException e1) {
    e1.printStackTrace();
    } catch (ClassNotFoundException e1) {
    e1.printStackTrace();
    return b;
    }

    The first thing i notice is that there's a problem with your SQL statement.
    To start with you should probably be using PreparedStatements cause it deals with the passing of variables very well and cleanly.
    But if you must use a straight statement then it should be like this:
    String query = "SELECT * FROM Table1 WHERE username LIKE '"+un+"'" + " AND password LIKE '"+pass+"'";
    The fact that you were mising a few spaces wouldn't have helped. Although if you were to use a prepared statement, it would be a lot easier to understand where things were being passed and you don't need to worry about those single quotes for certain values.
    Wes

  • Use of jdbc in applets

    hi ,
    i am priya i am a learner of java and i am facing some of the problems in using jdbc with applets
    i am using ms-access as database and it shows some error messages when i compile the code such as
    access denied due to applet security etc
    So, please help me in this way so that i can use applets with jdbc
    thanx,

    I second that. Using JFrame instead of JApplet is easy once you've seen an example:
    http://java.sun.com/docs/books/tutorial/uiswing/learn/example1.html
    When learning Swing, I can think of only disadvantages to using JApplet over
    JFrame. Why do textbooks use applets? Old habits die hard and they
    are out-of-date in their view of Java.
    Side comment: when learning a new topic, like JDBC, I would
    strongly advice you to write the simplest possible code at first.
    In other words, skip the Swing and write simple console apps:
    1. select and dump the contents of a table.
    2. gradually do more sophisticated selects...
    3. insert a record into a table using some fixed values.
    3. delete records from a table.
    4. update records using some fixed values.
    Once you are comfortable doing CRUD, and used PreparedStatement!,
    then add a GUI. And if your code is well-written, the GUI and the back-end
    are separate enough anyway, that you can write and test them apart.

  • Jdbc in applets

    I get the applet panel displayed in a web page. however when the user clicks on the button contained within the panel, nothing happens. In the appletviewer clicking on the button leads to a applet window containing data retrieved from the database (which is required)???

    there is lots of stuff on this site about applet signing. It seems complicated at first but its not that bad. In fact, if you had looked first, you would see there is a signed applet forum (!)
    anyway, signing the applet is all very well but the crux of it is that applets connecting straight into databases is not good design. If you are just learning, however, then you might try it out but you probably won't (or at least shouldn't) be asked to do it on a job.
    maybe if u used a servlet for JDBC, and the applet could connect to that?

  • ___Secure JDBC and Servlets___

    Hey all! I have an applet that uses jdbc calls to an oracle database, and servlets calls to oracle's jserv servlet container. It has been requested to make these connections secure.
    Can someone please point me into the right direction on information/documentation on performing secure jdbc and servlet calls.
    Thanks!

     

  • JDBC Vs Applet

    Hi ,
    I have a problem in JSP that is I have to get some values from the table throug JDBC and I have to print that values on a Applet window. I think java applet window will not support for JDBC code. So How can I print all the values throgh Applet?
    With Regards
    Prakash.A

    The applet can make a socket connection or HttpUrlConnection back to the server it came from to request the data. You'll need a socket server or servlet on the server to do the SQL queru and return the data.

  • Help on RFC to JDBC and JDBC to RFC

    Help on RFC to JDBC and JDBC to RFC
    Hi Gurus
    I have the scenario where an RFC will be triggered in SAP , to write to a DB2 database and insert new records in a table
    and vice versa the JDBC has to read som data from a table based on a primary key, mark them as read for not be read next time and send the data to an RFC where a table in SAP will be updated.
    I have never worked with JDBC before , pls advice.
    is there any new issue to consider in PI 7.0 regarding JDBC
    Thanks.

    The requirement looks standard,
    SEARCH IN SDN FOR JDBC scenarios,you will find many docs for sender as well as Receiver.
    >
    > is there any new issue to consider in PI 7.0 regarding JDBC
    >
    no issue with PI7.0.
    Regards,
    Raj

  • IDoc to JDBC  and JDBC to IDoc Scenario

    Dear All,
    I am working on IDoc to JDBC and JDBC to IDoc Scenario.
    I have to send Idoc from SAP to Non SAP system(.NET application) i almost configured in XI but still i don't know when my INTEGRATION will INVOKE how my data will proceed from IDOC to Oracle database(Through JDBC) and in case of revese how and when Data flow will start.
    Does anyone have completed STEP by STEP scenario document for this?
    How my Idoc will sent to XI?
    How XI will pick up data from IDoc?
    How XI will Convert data to JDBC and UPDATE in Oracle Database?
    And i reverse case(JDBC to IDoc) when my INTEGRATION will INVOKE?
    Where and When i can watch my process and data?
    How can i test the whole integration?
    I AM GETTING ERROR WHILE TESTING CONFIGURATION IN Integration Directory "Error while refreshing the XI runtime cache" and when i check this in SXI_CACHE  it gives me error
    "Unable to refresh cache "NO_BUSINESS_SYSTEM"
    "Error during last refresh to cache"LCR_GET_OWN_BUSINESS_SYSTEM - NO_BUSINESS_SYSTEM"
    Please solve all the above problems i will reward u points
    thanks,
    RP

    Hi,
    While we working on IDOC to JDBC interface..
    We have to deploy JDBC Drivers?
    Go through this links,
    /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci1246926,00.html
    To install JDBC driver follow the how to guide.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
    Configuration of JDBC Adapter for SQL Server
    JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
    UserID and Password.
    If the connection is not working find the correct port number.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
    JDBC- X I -  R/3 Scenario
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Please check the driver path as mentioned below.
    JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
    Connection:jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//location of DB table.mdb;
    No JDBC driver required.
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    follow this thread
    Re: Problem when connecting to MS Access through JDBC Adapter.
    SAP Note 850116 has details
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Configuring the Sender JDBC Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/content.htm
    Configuring the Receiver JDBC Adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/676b3c255b1475e10000000a114084/content.htm
    Idoc Reveiver adapter..
    http://help.sap.com/saphelp_erp2004/helpdata/en/b9/c5b13bbeb0cb37e10000000a11402f/content.htm
    Thanks,
    Satya Kumar
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    Edited by: SATYA KUMAR AKKARABOYANA on May 8, 2008 5:51 PM

  • Content Conversion - JDBC and JMS

    Can we use File Content Conversion with JDBC and JMS ?

    Hi,
    How To Use the Content Conversion Module in JMS Adapter - https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&
    check this for JMS content conversion:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
    Check the how to guide provided by prabhu and also this link on the XMl To TeXtCoversion Module,
    http://help.sap.com/saphelp_nw04/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm
    Ref How To Use the Content Conversion Module in JMS Adapter -
    https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&
    See this weblogs which was shown with examples:
    How to use SAP's WebAS J2EE's JMS Queue in Exchange Infrastructure
    Sync/Async communication in JMS adapter without BPM (SP19)
    Async/Sync Communication using JMS adapter without BPM (SP 19)
    Exploring JMS and SAP-XI JMS Adaper
    Configuring the sender JMS adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/content.htm
    Configuring the receiver JMS adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/content.htm
    Check JMS Adapter section of this blog by Sravya:
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III
    Also information related to Provider-specific settings are available
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/frameset.htm
    Plz do refer the following threads:
    JMS Content Conversion - no CR/LF
    Message (Data) getting lost after JMS Content Conversion(Sender)
    Message (Data) getting lost after JMS Content Conversion(Sender)
    Message (Data) getting lost after JMS Content Conversion(Sender)
    Regards,
    Vinod.

  • JDBC and FTP sender channels stop polling

    Hi,
    We have a great volume of sender JDBC and FTP sender channels.
    For this reason there is nothing unusual to have temporary error connections.
    Several months ago, with an XI 3.0 system, sender channels recover its functionality  automatically when temporary error connection is solved.
    But now, he have migrate to a  PI 7.1 sytem, and in the same scenario and configuration,  sender channel stop polling after a temporary error . In cc monitor this channels remains in  green status and there were no signs of stopped interfaces.
    Timeouts are correctly defined and there is no difference between channel configuration in our Xi and PI system.
    How to solve this problem?
    Thanks, in advance.
    Carme.

    Thanks for your fast response, Stefan.
    After writing this post, i ask the same question to our basis team and  we are in the latest sp.
    ¿do you know if there is any note or can you provide me some additional information?
    I'm not able to find any note about this issue...
    Regards,
    Carme.

  • Adapter Limitations Of Sender  JDBC and Mail Adapter

    hi All,
    could you tell me the limitations of JDBC and Mail Adapter .i need to document these details .
    Regards
    Vidya Sagar

    HI Vidya,
    If i was you, i would do a list of things that i would need about these adapters, o i would search the SAP.help documentation for a first view and later ask about this possibility. Another way is to read the SCN doubts about these adapters and you can find some problems. You should think about the PI version as well.
    Regards.

Maybe you are looking for

  • StuckThreadMaxTime related errors in logs.

    Hi, I have already posted this in one of the threads: Re: Stuck Thread But there was no response. So creating a thread for it to garner more interest. If deemed inappropriate then request moderator to remove this post. We are doing this on HP machine

  • Inability to restore apps to new iphone 5s from encrypted backup

    Hi, thanks for any advice. I recently upgraded to iphone 5s following significant slowown of iphone 4 which until the ios 7 update was a perfectly usable device. I am now simply unable to fully restore a brand new iphone 5s from a full encrypted ipho

  • Oracle Service Bus: Content Type is defaulted to "mutlipart/related"

    I have scenario where I need to invoke a REST Webservice from OSB which accepts only media types which has "multipart/atom+xml". OSB is used for protocol transformation converting the SOAP request into the HTTP POST request with multipart. I have Pro

  • What is DBMS_PARALLEL_EXECUTE doing in the background

    What is the best way to see all the actual SQL's that are being executed in the background when a package is executed? For an example, I am interested in knowing what DBMS_PARALLEL_EXECUTE package is doing in the background. I've read what the proced

  • Re making a WP website in dreamweaver.

    Hi, Ok I have to remake a website in DW. The site i have to re make was originally completely made up in Wordpress. Please have a look - www.studioarte.info Firstly can any one tell me where i can get the script for the scrolling image header........