Why do I need a class or interface?

Why am I getting this error?
"ReportQueryBuilder.java": Error #: 202 : 'class' or 'interface' expected at line 484, column 12
This line is causing the error...what am I missing?
public Connection openCon(String sUid, String sPwd) throws ReportQueryBuilderException
        //connection
        Connection dbCon = "";
     }

"throws ReportQueryBuilderException"
You probably throw an uncaught exception from the parent class ... in whatever ReportQueryBuilderException is, change it to 'throws Exception' and debug it yourself if an Exception is ever created with a System.out.println or two

Similar Messages

  • Why do I still get class or interface expected error????

    I made sure I closed all the bracket, why do i still get the error.
    Please help
    * ShopCartServletHW3.java
    * Created on November 19, 2007, 5:42 PM
    package ITI;
    import java.io.*;
    import java.net.*;
    import java.lang.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * @author Administrator
    * @version
    public class ShopCartServletHW3 extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        private String pageTop01;
        private String pageTop02;
        private String pageTop03;
        private String pageTop04;
        private String pageTable01Top;
        private String pageTable01Bottom;
        private String pageBottom;
        private String pageItemEmpty;
        private String confirmTable01Bottom;
        private String confirmTableTop;
        private String confirmItemEmpty;
        private Hashtable pageItemList = new Hashtable();
        private Hashtable confirmItemList = new Hashtable();
        private double runningTotal;
        private ShopCartDataHW3 cartData;
        private InvTrackerHW3 invTracker;
        private Hashtable pastOrders;
        public void init() throws ServletException {
             PageTop01 = "<html>"
                    + "<head>"
                    + "<title>Blue Ridge Supply Shopping Cart </title>"
                    + "</head>"
                    + "<style type=\"text/css\">"
                    + "body {font-family: arial}"
                    + "h1 {color: navy}"
                    + "h2 {color: navy}"
                    + "h3 {color: white}"
                    + "h4 {color: white"
                    + "h5 {color: white}"
                    + "h6 {color: navy}"
                    + "p {color: navy}"
                    + "</style>"
                    + "<body>";
            pageTop02 = "<table border=\"0\" width=\"100%\" cellpadding=\"0\">"
                    + "<tr><td width=\"25%\" valign=\"top\">"
                    + "Shopper: ";
            pageTop03 = "<br>"
                    + "<a href=\"RegLoginServletHW3\"> [Log Out]</a>"
                    + " "
                    + "<a href=\"CatServletHW3\">[Continue Shopping]</a></td>"
                    + "<td width=\"50%\" valign=\"bottom\" align=\"center\"><h1>"
                    + "Blue Ridge Supply - Shopping Cart"
                    + "</h1>"
                    + "<td width=\"25%\" valign=\"top\" align=\"right\">"
                    + "Shopping Cart contains ";
            pageTop04 = " items </em> "
                    + "</td></tr></table><hr>";
            pageTable01Top = "<center><h3>"
                    + "Please review sections:"
                    + "</h3><table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\" bgcolor=\"navy\">"
                    + "<tr><th><h4><br>"
                    + "Quantity"
                    + "</h4></th<th><h4>"
                    + "Item"
                    + "</h4></th><th><h4>"
                    + "Unit Price"
                    + "</h4></th></th><h4>"
                    + "Total Price"
                    + "</h4></th></tr>";
            pageBottom = "</body></html>";
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)
                throws ServletException, IOException {
            HttpSession session = request.getSession();
            if (session.isNew() || session == null) {
                sessionError( request, response);
            String userID;
            if (session.getAttribute("userID") != null) {
                userID = (String)session.getAttribute("userID");
            } else {
                sessionError( request, response);
                userID = "";
            Integer cartCount;
            if (session.getAttribute("cartCount") != null)
                cartCount = (Integer)session.getAttribute("cartCount");
            } else {
                sessionError( request, response);
                cartCount = Integer.valueOf(0);
            if (session.getAttribute("pastOrders") != null)
                pastOrders = (Hashtable)
                session.getAttribute("pastOrders");
                } else {
                sessionError( request, response);
                pastOrders = new Hashtable();
            if (session.getAttribute("invTracker") != null)
                invTracker = (InvTrackerHW3)
               session.getAttribute("invTracker");
            String shiptoname;
            String streetaddress;
            String city;
            String state;
            String zip;
            String shipservice;
            String cctype;
            String ccname;
            String ccnum;
            String ccexpmonth;
            String ccexpyear;
            // Shipping information
            Hashtable shipHash;
            if ((session.getAttribute("shipping") != null))
                shipHash = ((Hashtable)session.getAttribute("shipping"));
            } else {
                shipHash = new Hashtable();
            String [] shipping = new String[5];
            if (shipHash.get(userID) != null)  {
                shipping = (String[])shipHash.get(userID);
                shiptoname = shipping[0];
                streetaddress = shipping[1];
                city = shipping[2];
                state = shipping[3];
                zip = shipping[4];
            } else {
                shiptoname = "";
                streetaddress = "";
                city = "";
                state = "";
                zip = "";
            if ((session.getAttribute("shiptoname") != null)) {
            shiptoname = filter((String) session.getAttribute("shiptoname"))
            // Credit information
            if ((session.getAttribute("shipservice") != null)) {
                shipservice = filter((String) session.getAttribute("shipservice"));
            } else {
                shipservice = "";
            if ((session.getAttribute("ccname") != null)) {
                ccname = filter((String) session.getAttribute("ccname"));
            } else {
                ccname = "";     
            if ((session.getAttribute("cctype") != null)) {
                cctype = filter((String) session.getAttribute("cctype"));
            } else {
                cctype = "";
            if ((session.getAttribute("ccnum") != null)) {
                ccnum = filter((String)session.getAttribute("ccnum"));
            } else {
                ccnum = "";
            if ((session.getAttribute("ccexpmonth") != null)) {
                ccexpmonth = filter((String) session.getAttribute("ccexpmonth"));
            } else {
                ccexpmonth = "";
            if ((session.getAttribute("ccexpyear") != null)) {
                ccexpyear = filter((String) session.getAttribute("ccexpyear"));
            } else {
                ccexpyear = "";
            if (session.getAttribute("cart") != null && session.getAttribute("cartKeys") != null)
                cartData = new ShopCartDataHW3((Hashtable) session.getAttribute("cart"), (Hashtable)
                session.getAttribute("cartKeys"));
            else {
                cartData = new ShopCartDataHW3(new Hashtable(), new Hashtable());
            String itemToAdd;
            itemToAdd = (findItemAttribute(request, response));
            if ((itemToAdd != null) && (cartData.getItemID(itemToAdd) == null)) {
                cartData.updateItemID(itemToAdd, 1);
            if (itemToAdd != null) {
                int defaultValue = (cartData.getQty(itemToAdd).intValue());
                int x = getIntParameter(request, itemToAdd, defaultValue);
                if (x < 0) {
                    // do nothing
                } else {
                    cartData.updateItemID(itemToAdd, x);
           Hashtable cart = new Hashtable(cartData.getCart());
           Hashtable cartKeys = new Hashtable (cartData.getCartKeys());
           session.setAttribute("cart", cart);
           session.setAttribute("cartKeys", cartKeys);
           Integer numberOfKeys = new Integer (cartKeys.size());
           session.setAttribute("cartCount", numberOfKeys);
           runningTotal = 0;
           Enumeration keyValues = cartKeys.elements();
           while(keyValues.hasMoreElements()) {
               String key = (String) keyValues.nextElement();
               if (key != null) {
                   setCartPage(key, cartData);
                   setConfirmItemList(key, cartData);
           if (numberOfKeys.intValue() == 0) {
               setCartPage(null, cartData);
           String shippingAndCredit = loadShippingAndCredit(shiptoname, streetaddress, city, state, zip, shipservice, cctype, ccname, ccnum, ccexpmonth, ccexpyear);
           if (numberOfKeys.intValue() == 0) {
               session.setAttribute("confirm", "");
           } else {
               setConfirm(session, cartKeys, numberOfKeys);
           showPage(request, response, userID, cartKeys, numberOfKeys, shippingAndCredit);
        private void showPage(HttpServletRequest request,
                HttpServletResponse response, String userId, Hashtable cartKeys, Integer numberOfKeys, String shippingAndCredit)
                throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            out.println(pageTop01 + pageTop02 + userID + pageTop03 + numberOfKeys + pageTop04);
            out.println(shippingAndCredit);
            out.println(pageTable01Top);
            Enumeration keyValues = cartKeys.elements();
            while(keyValues.hasMoreElements()) {
                String key = (String)keyValues.nextElement();
                if (key != null) {
                    out.println(pageItemList.get(key));
            if (numberOfKeys.intValue() == 0) {
                out.println(pageItemEmpty);
            out.println(pageTable01Bottom + pageBottom);
            out.close();
        private String findItemAttribute(HttpServletRequest request,
                HttpServletResponse response)
                throws ServletException, IOException {
            Enumeration paramNames = request.getParameterNames();
            while(paramNames.hasMoreElements()) {
                String paramName = (String) paramNames.nextElement();
                CatalogHW3 item = new CatalogHW3();
                if (item.getItem(paramName) != null) {
                    return paramName;
            return null;
        private void setCartPage(String key, ShopCartDataHW3 cartData) {
            String pageItemFormat00 = "<form action=\"ShopCartServletHW3\" method=\"post\"><tr bgcolor=\"white\"><td align=\"center\">"
                    + "<input type=\text\" name=\"";
            String pageItemFormat01 = "\" value=\"";
            String pageItemFormat02 = "\" size=\"3\" align=\"right\">"
                    + "<input type=\"submit\" name=\"Update\" value=\"Update\" />"
                    + "<br>";
            String pageItemFormat03 = "</td><td><img src=\"";
            String pageItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
            String pageItemFormat05 = "</td><td align=\"right\">";
            String pageItemFormat06 = "</td><td align=\"right\">";
            String pageItemFormat07 = "</td></tr></form>";
            DecimalFormat f = new DecimalFormat();
            if (key != null)  {
                int qtyOnHand = invTracker.getQtyOnHand(key);
                int qtyAvailable = qtyOnHand - cartData.getQty(key).intValue();
                if (qtyAvailable < 0) {
                    cartData.updateItemID(key, invTracker.getQtyOnHand(key));
                    qtyAvailable = 0;
                double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));
                pageItemList.put(key,          pageItemFormat00
                + cartData.getItemID(key)
                                             + pageItemFormat01
                + cartData.getQty(key)
                                             + pageItemFormat02
                + qtyAvaliable + " More Avaliable "
                                             + pageItemFormat03
                + cartData.getImagePath(key)
                                             + pageItemFormat04
                + cartData.getDescription(key)
                                             + pageItemFormat05
                + "$" + f.format(cartData.getCost(key))
                                             + pageItemFormat06
                + "$" + f.format(total)
                                             + pageItemFormat07);
                runningTotal = total + runningTotal;
            } else {
                pageItemEmpty = "<tr bgcolor=\"white\"><td colspan=\"4\" align=\"center\">"
                        + "Your Shopping Cart is empty ... Please buy something."
                        + "</td></tr>";
                runningTotal = 0;
            pageTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4> Total Order: $ "
                    + f.format(runningTotal)
                    + "</h4></td></tr></table>";
    private void setConfirmItemList(String key, ShopCartDataHW3 cartData) {
        confirmTableTop = "<center><h3>"
                + "Order Details"
                + "<table border=\"1\" cellpadding=\"10\" align=\"center\" valign=\"middle\">"
                + "<tr><th><h4><br>"
                    + "Quantity"
                    + "</h4></th<th><h4>"
                    + "Item"
                    + "</h4></th><th><h4>"
                    + "Unit Price"
                    + "</h4></th></th><h4>"
                    + "Total Price"
                    + "</h4></th></tr>";
        String confirmItemFormat00 = "<tr bgcolor=\"white\"><td align=\"center\">";
        String confirmItemFormat01 = "<td align=\"right\">";
        String confirmItemFormat02 = "</td><td>";
        String confirmItemFormat03 = "<img src =\"";
        String confirmItemFormat04 = "\" align=\"middle\" width=\"48\" height=\"48\"> ";
        String confirmItemFormat05 = "</td><td align=\"right\">";
        String confirmItemFormat06 = "</td><td align=\right\">";
        String confirmItemFormat07 = "</td></tr>";
        DecimalFormat f = new DecimalFormat();
        if (key != null) {
            double total = ((cartData.getQty(key).intValue() * cartData.getCost(key)));
            confirmItemList.put(key,
                                              confirmItemFormat01
                + cartData.getQty(key)
                                             + confirmItemFormat02
                                             + confirmItemFormat03
                + cartData.getImagePath(key)
                                             + confirmItemFormat04
                + cartData.getDescription(key)
                                             + confirmItemFormat05
                + "$" + f.format(cartData.getCost(key))
                                             + confirmItemFormat06
                + "$" + f.format(total)
                                             + confirmItemFormat07);
        confirmTable01Bottom = "<tr><td colspan=\"4\" align=\"Right\"><h4>TOTAL ORDER: $ "
                + f.format(runningTotal)
                + "</h4></td></tr></table>";
    private void setConfirm(HttpSession session,
            Hashtable cartKeys, Integer numberOfKeys)
            throws ServletException, IOException {
        StringBuffer confirm = new StringBuffer(confirmTableTop);
        Enumeration keyValues = cartKeys.elements();
        while(keyValues.hasMoreElements()) {
            String key = (String)keyValues.nextElement();
            if (key != null) {
                confirm.append((String)
                confirmItemList.get(key));
        if (key != null) {
            confirm.append((String)
            confirmItemList.get(key));
    confirm.append(confirmTable01Bottom);
    session.setAttribute("confirm", confirm.toString());
    private String loadShippingAndCredit(String shiptonmae, String streetaddress, String city, String state, String zip, String shipservice, String cctype, String ccname, String ccnum, String ccexpmonth, String ccexyear) {
        String credit01;
        String credit02;
        String credit03;
        String ship01;
        String ship02;
        String ship03;
        String ship04;
        String ship05;
        String ship06;
        credit01 = "<form action=\"PurchConfServletHW3\" method=\"post\">"
                + "<table border=\"1\" cellpadding=\"10\" bgcolor=\"navy\" align\"center\">";
        ship01  =   "<center><h3>"
                + "Please provide your billing and shipping information: "
                + "<input type=\"submit\" name=\"Submit Order\" value=\"Submit Order\" />"
                + "</h3></hr>";
        String
        bill01  = "<tr><td bgcolor=\"white\">"
                + "Card Type:"
                + "<br>"
                + "<select name=\"cctype\">"
                + "<option value=\"Visa\" selected=\"selected\"> Visa</option>"
                + "<option value=\"MasterCard\" selected=\"selected\"> MasterCard</option>"
                + "<option value=\"American Express\" selected=\"selected\">American Express</option>"
                + "</select><br>"
                + "Card Number:"
                + "<br>"
                + "<input type=\"text\" name=\"ccnum\" value=\"";
      credit02  = "\"><br>"
                + "Cardholder Name:"
              + "<br>"
              + "<input type=\"text\" name=\"ccname\" value=\"";
      credit03  = "\"><br>"
                + "Expiration Date:"
              + "<br>"
              + "<select name=\"ccexpmonth\">"
              + "<option value=\"Jan\">Jan</option>"
              + "<option value=\"Feb\">Feb</option>"
              + "<option value=\"Mar\">Mar</option>"
              + "<option value=\"Apr\">Apr</option>"
              + "<option value=\"May\">May</option>"
              + "<option value=\"Jun\">Jun</option>"
              + "<option value=\"Jul\">Jul</option>"
              + "<option value=\"Aug\">Aug</option>"
              + "<option value=\"Sep\">Sep</option>"
              + "<option value=\"Oct\">Oct</option>"
              + "<option value=\"Nov\">Nov</option>"
              + "<option value=\"Dec\">Dec</option>"
              + "</select>"
              + "</td>";
      String
      ship00  = "<td bgcolor=\"white\">"
              + "Ship To Name:"
              + "<br>"
              + "<input type=\"text\" name=\"shiptoname\" size=\"37\" value=\"";
      ship02  = "\"<br>"
              + "Street Address:"
              + "<br>"
              +  + "<input type=\"text\" name=\"streetaddress\" size=\"37\" value=\"";
      ship03  = "\"<br>"
              + "City State Zip:"
              + "<br>"
              + "<input type=\"text\" name=\"city\" size=\"20\" value=\"";
      ship04  = "\">"
              + "<input type=\"text\" name=\"state\" size=\"2\" value=\"";
      ship05  = "\">"
              + "<input type=\"text\" name=\"zip\" size=\"5\" value=\"";
      ship06  = "\"</td>";
      String
      ship00a = "<td bgcolor=\"white\">"
              + "<input type=\"radio\" checked=\"checked\" name=\"shipservice\" value=\"UPS Ground\">UPS Ground"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"UPS 2nd Day Air\">UPS 2nd Day Air"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"FedEx Priority\">FedEx Priority"
              + "<br><br>"
              + "<input type=\"radio\"  name=\"shipservice\" value=\"FedEx Ultra\">FedEx Ultra"
              + "</td>";
      String
      ship00c = "</tr>"
              + "</table></form>";
      return credit01
              + ship01
              + bill01
              + ccnum
              + credit02
              + ccname
              + credit03
              + ship00
              + shiptoname
              + ship02
              + ship03
              + streetaddress
              + city
              + ship04
              + state
              + ship05
              + zip
              + ship06
              + ship00a
              + ship00c;
    private void sessionError(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        String sessionErrorForm;
        sessionErrorForm = "<form action=\"RegLoginServletHW3\" method=\"post\"><tr bgcolor=\"white\"> <td align=\"center\">"
                + "<h3 align=\"center\">Your request has not been processed - some isseues were found. <br> Please return to the Login page. </h3>"
                + "<input type=\"submit\" name=\"Go to Login\" value=\"Go to Login\" /></form>";
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        out.println(pageTop01 + sessionErrorForm);
        out.close();
    private String filter(String input) {
        StringBuffer filter = new StringBuffer(input.length());
        char c;
        for(int i=0; i<input.length(); i++) {
            c = input.charAt(i);
            if (c == '<') {
                filtered.append("<");
            } else if ( c == '>') {
                filtered.append(">");
            } else if ( c == '"') {
                filtered.append(""");
            } else if (c == '&') {
                filtered.append("&");
            } else {
                filtered.append(c);
        return(filtered.toString());
    private int getIntParameter(HttpSevletRequest request,
            String paramName,
            int defaultValue) {
        String paramString = request.getParameter(paramName);
        int paramValue;
        try {
            paraValue = Integer.parseInt(paramString);
        } catch (NumberFormatException nfe) { // null or bad format
            paramValue = defaultValue;
        return(paramValue);
    //<editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** Handles the HTTP <code>GET</code>method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    /** Handles the HTTP <code>POST</code>method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
        return "Short description";
    // </editor-fold>
    }

    When you have errors, you should post them.
    I got 72 errors when I tried to compile the code you posted. Many of them are due to syntax errors like { and } not lining up.

  • Why do we need public classes?

    I read that a public class is more visible than a default (non-public) class as the latter is merely "package-visible". However, it appears that even if a class (c in package p) is not declared to be public, it can still be accessed by:
    1) p.c
    2) import p.c
    So what is the use of declaring a class to be public? Why can't we just write:
    class c {...}
    every time for every class without the modifier public.
    Can someone show me an example that illustrates the difference between a public class and a default class?

    I read that a public class is more visible than a
    default (non-public) class as the latter is merely
    "package-visible". However, it appears that even if a
    class (c in package p) is not declared to be public,
    it can still be accessed by:
    1) p.c
    2) import p.c
    How does that appear so?
    Trying to do it the compiler says that "p.c is not public in p; cannot be accessed from outside package" and does not generate a class file.

  • Why do we need Persistent Classes ?

    Dear OO Gurus,
    I just finished the chapter on "Persistent Objects" in "ABAP Objects - ABAP Programming in SAP NW by Horst Keller".
    I could really appreciate its utility though. Googled a bit, read a few blogs on SCN but still the utility remains blurred.
    I would like to know what is the advantage of Persistence Classes over Open SQL.
    BR,
    Suhas

    I would like to know what is the advantage of Persistence Classes over Open SQL.
    Let's first start with what SAP says about the [persistence service|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f5/a36828bc6911d4b2e80050dadfb92b/frameset.htm]:
    The Persistence Service lets the ABAP programmer work with relational database data in an object-oriented way.
    So we're talking here about an [ORM|http://en.wikipedia.org/wiki/Object-relational_mapping] framework. I.e. the persistent storage of data is realized in SAP via a [relational database|http://en.wikipedia.org/wiki/Relational_database], where the data model is not object oriented. Let's say that you have created a class sales order and want to store and retrieve sales order objects (i.e. specific instances of this class). If you have a relational database, you have to model a corresponding schema for representing your sales order class and then "handcode" the translation from database tables into sales order objects and vice versa.
    Now imagine a world where you have a nice ORM, that does the work for you. E.g. look at web frameworks like [grails|http://www.grails.org/] making heavy use of [convention over configuration|http://en.wikipedia.org/wiki/Convention_over_configuration], which allow you to easily generate database representations from your objects (without tons of coding/effort!). Essentially you can start off with your class definitions, define some attributes and the framework (ORM) will automatically generate the corresponding database tables for you.
    Contrast that with SAP (see online help on [mapping assistant for persistence classes|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/d9/b84508bc9411d4b2e80050dadfb92b/frameset.htm]):
    You may have to create new database tables, database views, or structures for the object model in the ABAP Dictionary. At present the system does not perform this function automatically.
    So in general the ORM is supposed to make the developer's life easier by providing a framework for translating objects into (relational) database tables. However, sometimes the automatic translation/generation along with the default access methods is not optimal and that's where you actually go back to code your own SQL statements for doing the database-to-object conversions and vice versa. So the SAP persistence classes still use OpenSQL under the hood, but in some cases (e.g. mass processing), you might want to tune the used SQL statements yourself...
    I apologize for the long excursion, but in the end my view on persistence classes is quite simple: Use them if they make your life more simple and your coding less complex, without causing any bigger performance hit - otherwise stick to handcoded SQL statements... (long live [KISS|http://en.wikipedia.org/wiki/KISS_principle]!)
    Cheers, harald

  • Why is U51 blocking individual class files not in jars but U45 accepted them?

    Let me answer the "why do you need individual class files?" question first. We have a rather large applet based application with a current client-side minimum jar download size of 1.8 MB. If we put ALL of our class files into jars, that size will probably double. Most users only use a small portion of the class files for their particular tasks. Which of the class files they use depends upon the tasks they perform. Having ALL users download ALL the classes, albeit compressed in jars, is extremely time consuming and a major problem after application updates due to the large number of users and the network load it would cause.
    Jar file manifest:
    Permissions: all-permissions
    Codebase: *
    Application-Name: MyApplication
    Application-Library-Allowable-Codebase: *
    Caller-Allowable-Codebase: *
    Trusted-Library: true
    We have 11 directories with one containing the applet and main client application code. The other 10 directories contain class files relating to the various sub-applications in the system. The system has a third-party runtime jar file, too.
    We have a private network and servers for our business so the exposure is small. This is a screen-scraping, reformattring application that does no real data processing so doesn't need the same security as a true data processing application. Since we are not open to the Internet and of limited security risk, we chose to keep a more simplified structure.
    This all worked under 1.7.0_45. I read the security guide and it was my understanding that these attributes in the manifest would also work for U51. Apparently not. Looking at the guides, now, it appears they have been changed sometime last year regarding mixed-code to mean jars with certificates and jars without certificates. The support for individual class files appears to have been removed. If this is true, then there should have been a beta of the U51 code because the rules seem to have been changed since the last release or there is a new bug.

    This is exactly my same problem. My app (and applet) is about 5 MB if I consider all the classes and libraries used by the app. (I mean 5MB is the size of the jar file). I can't ask customers to download 5 MB every time they want to access the program.
    We need java ask code signing for the principal applet but then we must have the possibility to run single class files as needed.
    Help us all please.
    Thanks Paolo

  • What happens as we use strictfp modifier with class and interface ?

    I just knew that strictfp can't be used with variables?
    I want to know that why we use strictfp with class and interface?

    makpandian wrote:
    i hope i can understand if you explain myself.Okay, let me go ahead and try to explain yourself.
    The concept of a makpandian can be summed up as the following: a simple-minded, java forum-goer who posts questions directly from his SCJP 6 study guide in hopes that forum members will give him a simple answer that he can correlate to a multiple-choice response. By doing this, the makpandian suspects that passing the SCJP 6 exam will become a tangible reality, thus enabling it to obtain a job in the public work sector (given the great significance of this type of certification in the makpandian's presumed country of origin (India, for those of you who aren't following along)).
    So how'd I do? Did I do a good job of explaining yourself?

  • Why the console gives me the message "You should need class or interface"

    Today I copy some Java codes from the webs,I paste them on the EmEditor
    I run the program But the console give me the message "You should need class or interface" I think maybe i paste somes some errors on it So i type the program by myseif But aftering running it I get the same result "You should need class or interface"
    here is my code:
    public class foo
         static String s;
         public static void main(String[] args ){
              System.out.println("s="+s);
    }

    public class foo
         public static void main(String[] args )
    String s="Hello";
              System.out.println("s="+s);
    }run that, it will work.

  • Why do we need a Home Interface?

    Hi Guys,
    I am new to EJB. i am some questions.
    1) Why do we need a Homeinterface?
    2) Where does container generated classes for both the interface located(assume we have 2 machine, one is client and another is server)
    In RMI we hv stubs and skeletons located in client and server side....similarly how it is designed in EJB?
    Thanks & Regards
    -vijay

    In EJB3.0 the home interface has been removed. The purpose of home interface was to serve as a factory for finding/creating/destroying an enterprise bean instance. I am not sure why exactly the architects of ejb created a home interface. May be they thought its better to have a clear seperation of responsibilities, that is home interface for the above said purpose and component interface (a.k.a remote interface) for executing the business methods. Also you need to understand that the client never deals directly with a bean instance. The client always calls a bean's home or remote interface methods whose execution is delegated to the actual bean instance. This mechanism provided more flexibility for the container in creating and managing enterprise bean's instances. Hope this helps.

  • Why do we need a Self Reference "me" to use the components of a class

    Hi
    I am not clear why do we need a self reference variable "me" to call the components of its own class? when it can be accessed directly as in the following examples?
    In my first example below i can call the method display_name directly without creating a reference object or instance of the class within the class.
    In the second example i am using the self refernce Write me->name to access the component of a class.
    My question is why do we need "me" when i can use the components directly as shown in my first example.
    CLASS egocentric DEFINITION.
      PUBLIC SECTION.
        DATA:
         name(10) TYPE c READ-ONLY.
        METHODS set_name.
        METHODS display_name.
    ENDCLASS.                    "egocentric DEFINITION
    *       CLASS egocentric IMPLEMENTATION
    CLASS egocentric IMPLEMENTATION.
      METHOD set_name.
        MOVE 'Abap Objects' TO name.
        CALL method display_name.
      ENDMETHOD.                    "write_name
      METHOD display_name.
        write: name.
      ENDMETHOD.                    "display_name
    ENDCLASS.                    "egocentric IMPLEMENTATION
    *Global Data
    DATA oref TYPE REF TO egocentric.
    START-OF-SELECTION.
      CREATE OBJECT oref.
      CALL METHOD oref->set_name.
    CLASS egocentric DEFINITION.
            PUBLIC SECTION.
                DATA:
                 name(10) TYPE c VALUE u2018Instructoru2019
    READ-ONLY.
                 METHODS write_name.
    ENDCLASS.
    CLASS egocentric IMPLEMENTATION.
            METHOD write_name.
                WRITE me->name.
            ENDMETHOD.
    ENDCLASS.
    *Global Data
    DATA oref TYPE REF TO egocentric.
    START-OF-SELECTION.
            CREATE OBJECT oref.
            CALL METHOD oref->write_name.

    You can go WIKI and search with ABAP Objects.
    Or do the same in 'advanced search'  and select a search area. You are bound to find something.
    Or this link perhaps:
    [abap objects|http://help.sap.com/saphelp_nw70/helpdata/EN/ce/b518b6513611d194a50000e8353423/content.htm]

  • Why we need Java Class in c++ pof Serialization

    Hi,
    I'm really confused why we need java class which implements PortableObject to support complex objects of c++. If we are not using any queries or entry processors in the application can't we keep the object as serialized byte format and can't we retrieve in from the c++ deserialization.
    Please share your thoughts if there's a way if we can skip any Java implementation.
    regards,
    Sura

    feel both are doing same work. Also can anyone tell me what is teh difference between Serilization and Exgternalization.If you need someone to tell you the difference, (a) how can you possibly 'feel both are doing the same work'? and (b) why don't you look it up in the Javadoc?
    It's not a secret.

  • Why do we need material specification for transfering results to class char.

    Hi,
    Can you guys tell me why do we need to create material specification if we want to transfer quality inspection results to a batch class?
    Basically I have done the following:
    -Create Class Characteristic
    -Assign the Class Characteristic to a batch class
    -Link Class Char.  to MIC
    -Assign MIC to an Inspection Plan
    -Post GR, batch and inspection lot are created automatically
    -Record Results for inspection Lot
    -Make UD for Inspection Lot
    The result is not transferred to batch class, then I create material specification with the MIC assigned, the results can be transferred. But why?
    Best regards
    Danny

    Hello Danny,
    This is a standard program, which checks for this indicator at the time of inspection lot completion.
    F1- help gives satisfactory explanation
    Batch Valuation Possible Without Specification
    Use
    If you set this indicator, a link between the master inspection
    characteristics and the class characteristics for the batch class must exist
    when an inspection lot is created, for batch valuation to occur when the usage
    decision or inspection point valuation is made. A link within the material
    specification is not required.
    If you do not set this indicator, batch valuation only occurs when the
    usage decision or inspection point valuation is made, if a link using the
    material specification exists between the master inspection characteristics and
    the class characteristics for the batch class. In this way, you can control on a
    material-dependent basis whether the batch characteristics are valuated based on
    the inspection results.
    Amol.
    Message was edited by: Amol Manave : Main purpose is you can control whether Batch characteristics should be valuated based on results or not for particular material. If you set this indicator then batch characteristics will be valuated for all materials and in opposite case Batch characteristics will be valuated for only materials for which Material Specification exists.

  • Why do we need private static method or member class

    Dear java gurus,
    I have a question about the use of private and static key words together in a method or inner class.
    If we want to hide the method, private is enough. a private static method is sure not intended to be called outside the class. So the only usage I could see is that this private static method is to be called by another static method. For inner class, I see the definition of Entry inner class in java.util.Hashtable, it is static private. I don't know why not just define it as private. Could the static key word do anything better.
    Could anybody help me to clear this.
    Thanks,

    What don't you get? Private does one thing, andstatic does >something completely different.
    If you want to listen to music, installing an airconditioner doesn't help>
    Hi, if the private keyword is the airconditioner, do
    you think you could get music from the static keyword
    (it acts as the CD player) in the following codes:You're making no sense and you're trying to stretch the analogy too far.
    Private does one thing. If you want that thing, use private.
    Static does something completely different and unrelated. If you want that thing, use static.
    If you want both things, use private static.
    What do you not understand? How can you claim that you understand that they are different, and then ask, "Why do we need static if we have private"? That question makes no sense if you actually do understand that they're different.

  • Why do we need to Register a class ?

    When the class is already present in jar file then still why do we need to load the class and use it. The jar file is included in the lib and would be available for the environment.
    If any better explanation is provided will be very useful
    Thanking you in advance

    I assume you are talking about JDBC drivers over here. In general, otherwise you do not need to register classes.
    In JDBC, this has to do with how DriverManager works.
    When you load a driver class using the Class.forName(...) block, you are effectively executing the driver's static block.
    The static block has some code in it to register the class with the DriverManager by calling the static method DriverManager.register(Driver d).
    When your client code attempts to connect to a database by passing a JDBC-URL, the DriverManager iterates through the registered drivers and calls acceptsURL() on each of the drivers. The first driver to return a value of true gets to try connecting to the database.

  • Why do we need the @EJB annotation at the class level?

    Why do we need the @EJB annotation at the class level?
    Eg: Why do we need the first piece of code, when the second code seems much simpler .
    *1.*
    @Stateful
    @EJB(name="ejb/TradeLocalNm",
    beanInterface=TradeLocal.class)
    public class TradeClientBean implements TradeClientRemote {
    *2.*
    @Stateful
    public class TradeClientBean implements TradeClientRemote {
    @EJB private TradeLocal trd;
    }

    I think it is possible to do it in an aggregated level however you need to define your distribution rules in order to get the desired result, you need also to consider that if distribution rules changes and the value after promotional planning returns the same value, it is possible that detailed level are not realigned to the new distribution rule (e.g. regarding another ratio).
    Maybe this is one of several causes.
    Regards,
    Carlos

  • Why does EJB needs two interface???

    Hi All,
    This has been asked by many ppl and many of you might be having
    the correct answer for it. Please tell me....
    Why does EJB needs two interface (Home and Remote Interface)?. Why not one?
    Thanx to all...
    Regards
    GoodieGuy

    Hi Goodie ,
    Its good question and its a very valid one , one has to have doubt
    why two , why not one ..
    Here the answer goes ..
    First of all you need to understand that its a distributed computing technique ie I mean lot of people will be accessing the bean at the same time , right ? OK , you cann't access the bean directly.
    and lastly the stateless and entity beans do instance pooling.
    The very purpose of having two interfaces is
    1) To differnentiate the bussiness logic and life cycle methods .
    2) The home interface inititates life cycle methods like creation , destruction etc .
    3) There are lot of beans in the container , and through home you are
    creating the instance or accessing one of them .
    4) Once you have home object using it we get the remote object ie the instance of the bean that you want to access if stateless any bean can be called , if statefull depending upon the parameter in create method that respective bean is created and invoked .
    In ejb 1.0 and 1.1 even though the bean and the client are in same jvm its assumed that they are remote and in 2.0 Ver we have local this is to avoid network traffic .
    Hope you have got the answer , but if u still need clarification
    read EBRoman book first and second chapters thoroughly and then proceed
    a head.
    Bye
    Mahesh L.
    ============

Maybe you are looking for

  • Is there a way to view the iCal 'notes' field other than opening each event individually?

    I use the 'notes' field in iCal but it is not visible in any view other than opening each event individually.  Is there any way to make this field visible in the Day or Week view?

  • Merging "pages" and "numbers" to make a presentation in PDF "Preview"

    I am trying to put together a presentation in PDF form, that I can email out In numbers and pages , I can print them to PDF, and it looks great, but how do you merge the two into one PDF ??

  • CS3 crash on exit

    For those of you who have been experiencing AICS3 crashing (not responding) upon exiting, check if you have Microsoft's Intellipoint mouse driver 6.1 installed. Uninstall the driver (control panel applet). WinXP will revert to the basic mouse driver

  • Web deployment task fails

    For the last couple of days I cannot deploy web jobs from Visual Studio to azure. The site is running and I am able to access it and run existing jobs through the portal. I haven't changes any setting. I get this error: Error ERROR_DESTINATION_NOT_RE

  • Why is the second update in trigger not executing

    Hi all I'm just starting with pl/sql . My trigger works but the second update does not execute. why is it not executing? and how can I get it to execute? CREATE OR REPLACE TRIGGER bb_ordercancel_trg AFTER UPDATE OF idstatus ON bb_basketstatus FOR EAC