How can I obtain the resources in jar?

How can I obtain the resources in jar if the class that to want this resource is static?
I don't succeed use like:
getClass().getResourceAsStream("/" + name)
because my class is static.
Thaks

You could do this
new Object().getClass().getResourceAsStream("/" + name)
or
Object.class.getResourceAsStream("/" + name)

Similar Messages

  • How can I obtain the primary key of a table for an entity relation?

    hello everybody
    I am doing a consultation to a table in my data base, good this table has alone two fields, the first one is the code or pk and the second one is the description, to be presisos they are names of city and code.
    From the beginning!!: This method this one in another class that is a Dialog that is going to call to the class SelecPlace ();
      SelecPlace sl = new SelecPlace();
    public void capturarLugar(){  //  Simple void method in the mentioned class
            String place = txtProcedencia.getText() ;  //  a JTextField
            sl.executeStatement(place) ;                  
        }ok, now we see part of the code of the class SelectPlace
    public class SelecPlace extends AbstractTableModel{
        Connection con = null;
        Statement sentencia = null ;
        ResultSet rs = null;
        ResultSetMetaData rsmd = null ;
        String[] nameColum = {} ;
        Vector datos = new Vector() ;
        public SelecPlace() { }
        public void executeStatement(String query){
          try{
             con = DBManager.getConnection() ;
             sentencia = con.createStatement(rs.TYPE_SCROLL_INSENSITIVE,
                                                                          rs.CONCUR_UPDATABLE) ;
             String sql = "select * from Place where descripcion like %"+query+"%'";
              rs = sentencia.executeQuery(sql) ;
              rsmd = rs.getMetaData();
              int nroColumnas = rsmd.getColumnCount() ;
              nameColum = new String[nroColumnas] ;
              //obtengo los nombres de columnas en cache
               for(int colum = 0; colum < nroColumnas; columna++){
                    nameColum[colum] = rsmd.getColumnLabel(columna + 1) ;
               datos = new Vector();
                while(rs.next()){
                    Vector newRow = new Vector();
                    for(int i = 0; i < getColumnCount(); i++){
                    newRow.addElement(rs.getObject("place_ID"));
                    newRow.addElement(rs.getObject("description"));
                    datos.addElement(nuevaFila);
                fireTableChanged(null);
            }catch(SQLException e){
                System.err.println(e);
                e.printStackTrace(System.err);
                System.out.println("error in statement");
            }catch(ClassNotFoundException cnfe){
                System.err.println(cnfe);
        }Ok, this code me works and I obtain in this case the field description of the table Place
    Now my question is, how can I obtain the primary field of my table?
    I need this value of this field that in the base of information in a bigint, and to take it to the first class before mentioned, for that I am working with a data base related

    Certain duffymo and everyone!!, good I give you my scheme:
    And generalizing my question, I want to obtain the value of the primary key of a table in the database, I obtain more values of the same row, but I need the primary key, and you see one with the primary key I want to turn a Long and it to insert with code java in foreign clave in another table of the database
    Good of this form I believe that it would not be breaking the integrity relacional of the tables

  • Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Nothing in the Acrobat 8.x product family is compatible with Windows 7 (or any contemporary OS).
    The Acrobat 8.x product family passed into End of Support way back -- (November 2011).
    The current release of Acrobat (XI) is compatible in Windows 7.
    Be well...

  • How can I obtain the value of a database column in a JSP variable ?

    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

    Try something like
    String cnt = c1.getRowSet().getCurrentRow().getAttribute("Cont").toString();
    -A
    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

  • Hi,  I lost my serial number for PS Elements11 following computer crash. Os is W7. I have the cd installation disc but there is no serial number with it or in the envelope  ..  How can I obtain the serial number please?     Thanks

    I lost my seriel number for PS Elements 11 following computer crash. Os is W7
    Peter Jones Aug 27, 2014 5:36 AM   
    Hi,
    I lost my serial number for PS Elements 11 following computer crash. Os is W7. I have the cd installation disc but there is no serial number with it or in the envelope
    How can I obtain the serial number please?
    Thanks

    If you registered the software you should be able to find the serial number thru your Adobe account online.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • How Can I obtain the tables of one schema and the record size???

    How Can I obtain the tables of one schema and the record size???
    Example:
    TableName Record Size
    Tabla1 12500
    Tabla2 7800
    Tabla3 2046

    This is not an OWB question, but you can obtain bda-type information on tables by using the system view dba_tables.
    Regards:
    Igor

  • How can I obtain the web site template of the ''Imvelo Safari Lodges'' that appears on the Site of the day web page?

    How can I obtain the web site template of the ''Imvelo Safari Lodges'' that appears on the Site of the day web page?

    Hi Ginette,
    The site that you are referring to does not appear to be a template that you can get your hands on, however, I will suggest that you contact the owner via their contact us page and see what can be done.
    - Abhishek Maurya

  • Error -50103 : How can I get the resource which is reserved

    I get the error -50103 when I try to start two A0 task on two different channels. The error message tells me that "The specified resource is reserved".
    But how can I known what is the specified resource. Is that a clock signal, a buffer or what else ?
    More generally, how can I known the resources used by a task ? Is that a VI which can gives me all the resources used by a task?
    Thank for your answer
    Félix
    Software : Labview 7, Driver : daqmx 7.3,
    Board : PCI 6259 M serie

    Hello:
    I'm trying out a shipped example called PID-Control Multichannel VI and
    I'm getting the same error? How can NI shipped it with this problem?
    Anyway what should be the remedy here?
    Thanks,
    Berns
    Bernardino Jerez Buenaobra
    Senior Test and Systems Development Engineer
    Test and Systems Development Group
    Integrated Microelectronics Inc.- Philippines
    Telephone:+632772-4941-43
    Fax/Data: +632772-4944
    URL: http://www.imiphil.com/our_location.html
    email: [email protected]
    Attachments:
    PID Control-Multi Channel.vi ‏160 KB

  • How can I obtain the Pages app which I previously purchased from the App store for Snow Leopard? The only download now available is for Mountain Lion which my computer can't run. Thanks

    How can I obtain the Pages app which I previously purchased from the App store for Snow Leopard? The only download now available is for Mountain Lion which my computer can't run. Thanks

    Try Amazon but look for the iWork suite of software. It's only sold separately as Pages, Keynote, and Numbers from the App Store.

  • How can i locate the resource file in the weblogic?

    hello
    in struts, i can leave some parameter in a resource file (such as "Application.properties")outside of my code,and get them in the "Action" class by the "getResource" method.
    in my data access tier,i still want to use such a machanism but i can't use the "getResource()" method,for example,there is a ConnectionPool class,i want to read some parameters from a resource file ("param.properties") that is under the same directory as the ConnectionPool class,the following is the code snippet:
    public static void init(DataSource ds){
    myself=new ConnectionPool(ds);
    java.util.Properties prop=new java.util.Properties();
    try{
    java.io.FileInputStream fin=new java.io.FileInputStream("./param.properties");
    prop.load(fin);
    }catch(Exception e){
    e.printStackTrace();
    System.out.println(prop.get("help.create"));
    the "ConnectionPool" class is in the "com.jhtop.task.forum.db.util" package,the "param.properties" is in the same package (com.jhtop.task.forum.db.util),
    but when i execute the program,it tell me that it can't find the file.if i use the absolute path,it works.
    i wonder how can i locate the file path in the weblogic,or what's my current path,or how may i setup my work directory?
    in tomcat,my current directory is bin directory,how about weblogic?
    who can help me?thank you!

    My english is bad and I'm not sure I've well understood your problem.
    How have you created your file ?
    Why do you put it in such a directory and not an other ?

  • How can I obtain the coefficients m, b from MAX scale?

    I use CWAI ActiveX for acquire data. Also, I use MAX to set the virtual channels for CWAI. When I try to use scale option of MAX (for exemple y = 0.5x + 3 to transforn volts in my phisics values) I obtain true data from ScaledData (phisics values), but I can't obtain true data from (BinaryCodes x GetScaleMultiplyer) + GetScaleOffset. How can I obtain true value from binarycodes?
    How can I obtain m and b from ActiveX?

    drg,
    The GetScaleOffset & GetScaleMultiplier refer to the hardware factors used by the driver to transform the binary values produced by the ADC converter to actual Voltage values (not physical units of the Virtual Channel).
    The documentation (NI-DAQ 6.9.3) for the ScaleMultiplier property mentions this:
    "Returns the slope in the linear scaling formula for converting the binary codes of the analog-digital converter to voltages. The CWAI control multiplies the binary code by the ScaleMultiplier and adds the ScaleOffset to convert a binary code to a voltage.
    (BinaryCode * ScaleMultiplier) + ScaleOffset = Voltage"
    If the signal range was, for example +/- 5 V, the multiplier for a 12 bit board would be approximately 0.00244141 so that:
    2047 * 0.002441
    41 = 5V
    NOTE: The 12 bit range (4096 words) is divided into +2047 / -2048
    Unfortuantely there is not a function or method in the CWDAQ API to obtain or set parameters from the Custom Scales used by the Virtual Channels.
    The reason for this is probably due to the fact that once Virtual Channels are created, most users would read in scaled values directly rather than reading binary values, getting the scale constants and applying the custom scale themselves. Since the user specifies the values for the custom scales anyway, the application could as well store the scaling constants as part of its configuration.
    Still, it would be nice to have this functionality so I thank you for pointing this out. I will create a suggestion indicating the need for such functions.
    The ways to achieve the results you desire are:
    1) Use Virtual Channels and read scaled data
    or
    2) Use the ScaleMultiplier and ScaleConstants to transform binary values into actual voltage values. Once
    you obtain the voltage values you can manually apply the same custom linear scale you had created through MAX.
    Regards,
    Alejandro Asenjo
    Applications Engineer
    National Instruments

  • How can I obtain the first 10 charcter from field and the last 4 characters

    Hi
       I need to obtaind the first 10 characters from field AWKEY from BSEG table, and the last 4 characters, how can I obtain certains position from field??
        Example:
      AWKEY field from BSEG can be for example :
    51000573112002
       This mean that you can obtain separately:
    5100057311 - BELNR (field)
    2002- GJAHR (field)
        As you can see, the first 10 positions are BELNR and the last 4 positions are GJAHR.
         But sometimes you find in old rows:
    5100057312US502001
         This mean that you can get from this field:
    10 positions for BELNR : 5100057312
    4 positions for BUKRS or WERKS : US50  - in this case, I don´t know if its is BURKS or WERKS...for this reason only I want to take only the first 10 positions and the last 4 position to compare.
    4 posiition for GJAHR: 2001
       I rewards all the answers.
       Thank you.
    Alicia

    Hi, thank you for yours answers
    Let me try to explain more what I need to do:
    I have a Internal Table that I create with EKBE table:
      SELECT  MANDT EBELN EBELP GJAHR BELNR BEWTP BUDAT
              MENGE WRBTR WAERS WERKS SHKZG DMBTR
              ZEKKN VGABE BUZEI
        INTO CORRESPONDING FIELDS OF TABLE LIST_EKBE
        FROM EKBE
          WHERE EBELN IN R_EBELN
            AND BEWTP IN ('E','Q','R').
    The result is all the rows that have this conditions..then with this internal table I need to looking for each BELNR in BKPF table, but sometimes you can find the row compare EKBE-BELNR with BKPF-BELNR...but in many cases, you don´t find the row in this way, you need to add EKBE-BELNR and EKBE-GJAHR and looking for in BKPF with field AWKEY..
    For this reason I CONCATENATE in this way:
    LOOP AT LIST_EKBE.
        V_BELNR = LIST_EKBE-BELNR.
        V_GJAHR = LIST_EKBE-GJAHR.
        CONCATENATE V_BELNR V_GJAHR  INTO V_AWKEY.
        SELECT SINGLE MANDT BUKRS BELNR GJAHR AWKEY
        INTO (BKPF-MANDT, BKPF-BUKRS, BKPF-BELNR,
             BKPF-GJAHR, BKPF-AWKEY)
        FROM BKPF
        WHERE AWKEY = V_AWKEY.
    ENDLOOP.
      But I saw that sometimes you don´t find the record in BKPF because the AWKEY is formed with BELNRBUKRSGJAHR....or may be with BELNRWERKSGJAHR ...I don´t know if is BUKRS or WERKS the second field...for this reason I try only read in the select..if its posible the first 10 postions and the last 4 positions...but Im not sure if its possible..
      The reason for that I looking for the BELNR field in BKPF field for AWKEY its because sometimes de BELNR in BKPF its different..example:
    In EKBE you have:
    BELNR: 5105618260
    GJAHR: 2006
    If you looking for in BKPF you don´t find sometimes exactly the field BELNR : 5105618260.. then you need try looking for the AWKEY field then you need to add BELNR+GJAHR..example:
    BKPF:
    BELNR: 5105611111
    GJAHR: 2006
    AWKEY: 51056182602006
    But in other cases... I found that in AWKEY exist for example:
    BELNR: 5105611111
    GJAHR: 2006
    AWKEY: 5105618260US502006
    In the last case I supouse that I can divide in:
    AWKEY: 5105618260-US50-2006 ... but I don´t know what its the field that have the information US50..may be is BUKRS or may be its WERKS
    May be some people know what its exactly this field and can help me..
    With the solution that some of yours give me..I don´t know the how I can make the select? and if its posible make in this way
    Thank you a lot

  • How can I obtain the last purchase price

    Hi,
    there is a method to obtain the list of last purchase price??
    Thx
    Best Regards

    hi,
    I've tried the PriceList Obj and GetItemPrice but nothing to do....
    I would like obtaining the second Price List row in the Price Lists Form (Inventory\Price Lists\Price Lists).
    If I enable Debug Information I can obtain ListNum but the first two rows have the ListNum set to -2 and -1
    With the PriceList.GetByKey method if I set the parameter with -1 or -2 doesn't work... There is a way to obtain this PriceList?
    Thanks a lot
    Best Regards

  • I have Snow Leopard and would like to upgrade to Moutain Lion OS but I am only allowed 3 gigs of download data /mo. and Mt.Lion is 4 gigs. So How can I obtain the upgrade. The apple store does not sell the upgrade on a CD. It is only available by download

    I have Snow Leopard OSx on my MacBookPro. I would like to upgrade to Mt.Lion. OSx but am only allowed 3 gigs/mo download of data from my internet provider. I've attempted to purchase a CD from Apple store but they said it's only available through on-line downloads. How can I upgrade?

    Contact Customer Service: Contacting Apple for support and service - this includes international calling numbers.

  • I lost some of my contacts from both my iphone 5 and ipad I for no reason at all...how can I obtain the info back?

    I woke up one morning this week to find that some of my contacts have been deleted from my iphone 5 and ipad first generation. This is very random and my icloud is not showing the missing numbers either. Does anyone know if there are any other back ups that apple has to the contact lists? or How I can retrieve them?

    Do you see those in www.icloud.com? Yes- sign in to icloud on the phone.
    No- how did you get those to the ipad?

Maybe you are looking for

  • FD32 Master Data View

    Dear Gurus, Currently if I am using the fd32 transaction, and go into the payment history tab page, its shows me the blank data, would any of my guru confirm me the reason, and if I required how can I activate this, and what is the core purpose for t

  • Inbound idoc to create outbound delivary with ref to sales order

    Hi,        I am getting and inbound idoc from the external party to create Inbound delivary with reference to sales order.        But my inbound process code FM(IDOC_INPUT_DESADV1) checking PO no. and item which is NON SAP PO no. and item in idoc.  S

  • If I uninstall PS Elements 6, will I lose the info in Bridge??

    I have been trying for several days to download the free actions from www.thepioneerwoman.com. Each time has been a failed attempt. I have checked the "photo effects" folder and the actions are there. I rename the mediadatabase.db3 to mediadatabaseOL

  • Voicemail alert repeats when opening voicemail?

    This has been happening for so long I don't remember when it started, but maybe with iOS 8, or one of the subsequent updates?? The issue is this: I miss a call, and the caller leaves me a message. I have on of the older 'Classic' sounds set as my voi

  • Phoshop CS3

    This is a multi-part message in MIME format. ------=_NextPart_000_00B9_01C85935.7A472200 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Les paso una direcci=F3n por si les interesa bajarse unos tutoriales e