Enumeration equivalent in 1.4.2

Hey all,
I would like to be able to enumerate a group of strings similar to what C allows and 1.5 allows.
If i have 3 strings (orange, apple, banana), i would like to be able to compare to see which one has a greater value. For example, apple > orange, banana > apple > orange kinda thing.
Is this possible in 1.4.2?

I understand the implementation of Comparable and the compareTo method, but my question is more focusing on the logic inside the compareTo method.
I have a finite list (Hashmap, arraylist, etc) it doesn't matter.
I think of it this way. I have the array of strings: "employee", "manager", "vice president", "president" and their value is in that order. Therefore manager is > than employee, and president is greater than all of them. If i read in a handful of job positions from a file, i want to find the highest job position filled. And i feel that i would have to compare that to my array above.
The logic i have come up with does the job, but it is far from ideal, and i don't know how i would implement a good solution.
This is my current code:
private boolean compare(String empPosition, String highest)
       HashMap valueHash = new HashMap();
       valueHash.put("employee", new Integer(1));
       valueHash.put("manager", new Integer(2));
       valueHash.put("vice president", new Integer(3));
       valueHash.put("president, new Integer(4));
       if (valueHash..containsKey(empPosition))
           if (valueHash..containsKey(highest))
              // ((Integer) valueHash..get(empPosition)).intValue()
               if (((Integer) valueHash..get(empPosition)).intValue() >
                   ((Integer) valueHash..get(highest)).intValue())
                   return true;
           else
               return true;
       return false;thanks
Message was edited by:
jmgreen7

Similar Messages

  • Iterator vs Enumeration

    Does anyone know how to produce the equivalent of an Enumeration with the new Collection classes like ArrayList and HashMap?
    My situation is that I've got a collection (ArrayList) inside of my class, and I'd like clients to be able to see what's in this list without being able to change the list (ie Iterator.delete()) Is there any way to disable the Iterator.delete operation?
    The solution I'm going with right now is just to use the old collections (ie Vector and Hashtable) which still have the .elements() method.
    Ps. Is this a bug in Java?

    1. Performance: The docs say that the unmodifiableXXX
    methods put a 'view' on the collection so it cannot
    be modified. My guess (well, if I had to do this,
    this is what I'd do) is that they create a
    lightweight dummy list object to sit between the
    client and the list and to pass on all non-changing
    operations. However this affects space and time.The affect performance and space is generally going to be negligible. I've never run into trouble doing things like this. Also note that creating an immutable Iterator wrapper it extremely quick and easy and could be an option if all you are doing is returning an Iterator.
    2. Safety: If you're going to make a collection
    immutable and disable some of its functionality by
    throwing a RuntimeException, shouldn't there be a way
    to ask "is this collection immutable or not?"
    Otherwise, you have to either just know what it is or
    be extremely paranoid or just allow things to fail
    unexpectedly.Your API should specify this. If someone tries to modify the list, it will become apparent during development, which is what you want. If you need to sometimes return modifiable and sometimes not, then you will need to address this with a more complicated API.

  • Inheritance in Enumerations to provide subsets?

    I know that there is no such thing as inheritance in enumerations, but I think it might be useful whenever the developer needs to define a subset relationship.
    E.g.:
    public enum A {
    V1,
    V2,
    V3,
    V4
    public enum B extends A {
    V1,
    V2
    Semantically, the developer is saying that B is a subset of A.
    This means that the value A.V1 is the same value as B.V1.
    A user could pass a B in place of an A, and B would have all the properties of A.
    Can anyone think of an argument why this should or should not be in the language?

    Personally, I don't see any advantage with your suggestion, compared to the already existing EnumSet class. A couple of disadvantages with your suggestion are:
    * It is not obvious that an enum extension is equivalent to a subset. That seems rather arbitrary to me (in fact, I find it counter-intuitive).
    * It unnecessarily complicates the language.
    Just my 2 cents, of course.

  • What is the java equivalent to #define

    Hi,
    What would this declaration be in java:
    #define     STRAIGHT_FLUSH     1
    Many thanks, Ron

    There is no direct equivalent. As mentioned, enums can be used to fill one of #define's roles. (enumerated values)
    public static final constant member variables can fulfill another. (named constants)
    And actually, if I understand correctly, #define is not part of the C language per se, but belongs in the realm of the preprocessor, and you can run Java code through a c preprocessor.
    EDIT: Yeah, you can:
    :; cat X.java
    #define blah int
    public class X {
      Y y;
      blah x;
    jeff@shiro:/tmp 14:33:34
    :; cpp -P !$
    cpp -P X.java
    public class X {
      Y y;
      int x;
    }Message was edited by:
    jverd

  • Calculating Enum Values that aren't powers of two using the current enumeration values

    // SortedSet is not necessary but it has convenient Min and Max properties.
    SortedSet<MyEnum> enumValues = new SortedSet<MyEnum>();
    foreach (MyEnum e in Enum.GetValues(typeof(MyEnum)))
    enumValues.Add(e);
    // enumValues.Max * 2 to check all combinations including the last flag.
    for (int i = (int)enumValues.Min + 1; i < (int)enumValues.Max * 2; i++)
    MyEnum currentlyChecked = (MyEnum)i;
    // if there's no equivalent of i defined in MyEnum
    if (!enumValues.Contains(currentlyChecked))
    string representation = "";
    // Iterate over all MyEnum flags which underlying value is lower than i
    // and add those flags which are contained in (MyEnum)i to the string representation
    // of the value missing from the MyEnum enumeration.
    foreach (MyEnum lowerValue in enumValues.Where(e => (int)e < i))
    if (currentlyChecked.HasFlag(lowerValue))
    representation += lowerValue.ToString();
    if (String.IsNullOrEmpty(representation))
    representation = "[MISSING FLAG]";
    if (representation.Contains("None") | representation.Contains("Undefined"))
    representation = representation.Replace("Undefined", "");
    representation = representation.Replace("None", "");
    Console.WriteLine("Missing value: {0} - {1}", i, representation);
    I have the above code, which works great when The type of the Enumeration is known. However, the actual code is loading the Enumerations through reflection and placing the values and names into a Dictionary <int, string>. I need to be able to use the
    above code with my dictionary to achieve the same result, however  when I try to modify the above code for the dictionary, I run into a problem.
    The Enum that it is scanning looks like this:
    [Flags]
    public enum Method
    Undefined = 0,
    Site = 1,
    Manual = 2,
    API = 4
    and the output should be
    3: SiteManual - This works fine
    5: PortalAPI
    6: ManualAPI
    7: SiteManualAPI
    However, the output it is giving me is
    3: SiteManual
    5: SiteManualAPI
    6: SiteManualAPI
    7: SiteManualAPI
    How do I adapt the above code so I can calculate the proper values without having Enum type, since I can't seem to create the sorted set from the reflection type.

    I guess you want something like this:
    int someValue = 5;
    string result = ((int[])Enum.GetValues(typeof(Method)))
    .Aggregate("", (a, s) =>
    if ((someValue & s) != 0)
    a += Enum.GetName(typeof(Method), s) + " ";
    return a;
    // someValue=5 -> Site API
    // someValue=6 -> Manual API
    // someValue=7 -> Site Manual API
    // someValue=13 -> Site API

  • Enumerating Folders and Files with JSP

    Coming from the ASP world, I am wondering if there is a JSP equivalent to the ASP FileSystemObject for enumerating folders and files.
    Thanks in advance for the help.

    U can make use of File class of java.io for this..
    regards
    Shanu

  • Equivalent of MS Access First Function in SQL for Group By

    We previously had an Access database performing operations. We are now converting it over to SQL. There are queries in Access that use the "First" function to insert data, which I have not been able to find the equivalent to in SQL. Below is an
    example showing the data used, the SQL syntax and the results that it would produce.
    tbl_Data
    FirstN LastN CustNum TDate SalesPer
    Jim Smith 11111 5/10/2014 Jim Johnson
    Sally Jones 22222 5/12/2014 Alan Brown
    Sally Jones 22222 5/10/2014 Ben Doers
    Jim Smith 11111 5/12/2014 Jim Johnson
    Frank Oliver 33333 5/15/2014 Jim Johnson
    Results to be inserted into tbl_Main
    FName LName CustID TransDate SalesPerson
    Jim Smith 11111 5/10/2014 Jim Johnson
    Sally Jones 22222 5/10/2014 Ben Doers
    Frank Oliver 33333 5/15/2014 Jim Johnson
    Below is the SQL that will produce this
    INSERT INTO tbl_Main ( FName, LName, CustID, TransDate, SalesPerson)
    SELECT td.FirstN, td.LastN, td.CustNum, First(td.TDate) As SellDate, First(td.SalesPer) As SP
    FROM tbl_Data td
    GROUP BY td.FirstN, td.LastN, td.Cust;
    If anyone could assist me in an alternative that I could use in SQL to yield the same results, I'd appreciate it.

    tbl_Data
    FirstN LastN CustNum TDate SalesPer
    Jim Smith 11111 5/10/2014 Jim Johnson
    Sally Jones 22222 5/12/2014 Alan Brown
    Sally Jones 22222 5/10/2014 Ben Doers
    Jim Smith 11111 5/12/2014 Jim Johnson
    Frank Oliver 33333 5/15/2014 Jim Johnson
    Results to be inserted into tbl_Main
    FName LName CustID TransDate SalesPerson
    Jim Smith 11111 5/10/2014 Jim Johnson
    Sally Jones 22222 5/10/2014 Ben Doers
    Frank Oliver 33333 5/15/2014 Jim Johnson
    Below is the SQL that will produce this
    INSERT INTO tbl_Main ( FName, LName, CustID, TransDate, SalesPerson)
    SELECT td.FirstN, td.LastN, td.CustNum, First(td.TDate) As SellDate, First(td.SalesPer) As SP
    FROM tbl_Data td
    GROUP BY td.FirstN, td.LastN, td.Cust;
    As an aside that query is not correct in Access -  because you did not specify an ORDER BY the resultset has no particular order so you could get either row for Jim or Sally.
    It's a bit of a tricky one as it may on the surface appear that the resultset is always returned in a consistent order but this is not guaranteed (not in Access and certainly not in SQL server)

  • Is there a logic:match equivalent for JSTL?

    In a search page I execute a query which returns an array of objects (All objects are of the same object type and are cast to Object[]) and each object has many attributes. I tried using <logic:iterate>, but I was never successful in having it display any results. I believe this had something to do with the entire array being passed via session scope instead of just one record and me not specifying it properly with <logic:iterate>. I was able to successfully use <c:forEach> and it worked right away. I stuck with using that because of its "just works" ability in addition to using a lot of other JSTL code. However, one of the attributes that is being printed out needs to be parsed and is of the form "Yxxx". <logic:match> covers this very nicely, but when I specify it in the below code it is not able to find my variable in any scope.
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match parameter='${myResults}' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>I have done several google searches, but I haven't found a JSTL equivalent for <logic:match>. If there is one could someone please tell me what it is? In addition, although <logic:match> is great I still need to print out a substring of that attribute. Could someone tell me how to do that? If this is not possible could someone please tell me if its possible to use <logic:iterate> with an array of objects like I was attempting to do initially so that I could use <logic:match> at least?
    Thanks to all of you for your time.

    Yes you can use the logic:iterate tag. I think you have to specify the type of the exposed variable though. I prefer the forEach loop.
    I think you are using the wrong attribute in the logic:match tag. You should be using the "name" attribute rather than "parameter"
    Parameter attribute refers you to a request parameter, and I pretty sure you don't want that.
    So given the collection of objects in the session attribute "result"
    This should loop through them all, and see if they start with the letter 'Y'
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match name='myResults' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>As for the latter bit, are you using a JSP2 container and JSTL1.1? It would appear so seeing as you are trying to use EL expressions in the logic:match tag.
    If so, you could make use of the JSTL function library:
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
       <c:if test='${fn:startsWith(myResults.pin, "Y")}'>
          <c:out value="${fn:substring(myResults.pin, 1, -1)}"/>
        </c:if>
    </c:forEach>And I've just spotted a very cool function in there: substringAfter
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
          <c:out value='${fn:substringAfter(myResults.pin, 'Y')}'/>
    </c:forEach>Cheers,
    evnafets

  • What is equivalent of JInternalFrame in JavaFX 2.0?

    what is equivalent of JInternalFrame in JavaFX 2.0?
    Actually I want to use pure javaFX 2.0 to view report created in iReport 5.0.0.
    I have used java.swing code, and now I want to use pure javaFX 2.0.
    My code in swing is as follows
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.HashMap;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.view.JRViewer;
    * @author TANVIR AHMED
    public class ReportsViewer extends javax.swing.JInternalFrame {
    * Creates new form MyiReportViewer
    private ReportsViewer()
    super("Report Viewer",true,true,true,true);
    initComponents();
    setBounds(10,10,600,500);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    public ReportsViewer(String fileName)
    this(fileName,null);
    public ReportsViewer(String fileName,HashMap parameter)
    this();
    try
    /* load the required JDBC driver and create the connection
    here JDBC Type Four Driver for MySQL is used*/
    //Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "invoice", "item");
    //Connection con=DriverManager.getConnection("jdbc:mysql://localhost/inventory","root","karim");
    /*(Here the parameter file should be in .jasper extension
    i.e., the compiled report)*/
    JasperPrint print = JasperFillManager.fillReport(
    fileName, parameter, con);
    JRViewer viewer=new JRViewer(print);
    Container c=getContentPane();
    c.setLayout(new BorderLayout());
    c.add(viewer);
    catch(SQLException sqle)
    sqle.printStackTrace();
    catch(JRException jre)
    jre.printStackTrace();
    * This method is called from within the constructor to initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is always
    * regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 394, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 290, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    // Variables declaration - do not modify
    // End of variables declaration
    and
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.beans.PropertyVetoException;
    * @author TANVIR AHMED
    public class MainUI extends javax.swing.JFrame {
    * Creates new form MainUI
    public MainUI() {
    super("REPORTS");
    initComponents();
    setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize());
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jMenuItem1 = new javax.swing.JMenuItem();
    desktopPane = new javax.swing.JDesktopPane();
    salesTaxInv = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    supplyRegister = new javax.swing.JButton();
    PartyLedger = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    jMenuItem1.setText("jMenuItem1");
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    desktopPane.setBackground(new java.awt.Color(255, 204, 0));
    desktopPane.setBorder(new javax.swing.border.MatteBorder(null));
    desktopPane.setForeground(new java.awt.Color(255, 0, 102));
    desktopPane.setAutoscrolls(true);
    desktopPane.setFont(new java.awt.Font("Bookman Old Style", 0, 14)); // NOI18N
    desktopPane.setPreferredSize(new java.awt.Dimension(1024, 768));
    salesTaxInv.setBackground(new java.awt.Color(255, 255, 255));
    salesTaxInv.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    salesTaxInv.setForeground(new java.awt.Color(204, 0, 0));
    salesTaxInv.setText("Sales Tax Invoice");
    salesTaxInv.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    salesTaxInvActionPerformed(evt);
    salesTaxInv.setBounds(20, 53, 200, 31);
    desktopPane.add(salesTaxInv, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLabel1.setFont(new java.awt.Font("Bookman Old Style", 0, 24)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(50, 72, 255));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Invoice System Reports");
    jLabel1.setBounds(0, -1, 1024, 50);
    desktopPane.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    supplyRegister.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    supplyRegister.setForeground(new java.awt.Color(204, 0, 0));
    supplyRegister.setText("Supply Register");
    supplyRegister.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    supplyRegisterActionPerformed(evt);
    supplyRegister.setBounds(20, 100, 200, 30);
    desktopPane.add(supplyRegister, javax.swing.JLayeredPane.DEFAULT_LAYER);
    PartyLedger.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    PartyLedger.setForeground(new java.awt.Color(204, 0, 0));
    PartyLedger.setText("Party Ledger");
    PartyLedger.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    PartyLedgerActionPerformed(evt);
    PartyLedger.setBounds(20, 140, 200, 30);
    desktopPane.add(PartyLedger, javax.swing.JLayeredPane.DEFAULT_LAYER);
    setJMenuBar(menuBar);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    private void salesTaxInvActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/INV.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void supplyRegisterActionPerformed(java.awt.event.ActionEvent evt) {                                              
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/supplyRegister.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void PartyLedgerActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/CustomerLedger.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new MainUI().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton PartyLedger;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JButton salesTaxInv;
    private javax.swing.JButton supplyRegister;
    // End of variables declaration
    Best Regards

    Dear Sir,
    I am using the swing code and running the jasper report with the above code.
    Realy!
    I start the thread with this code
    @FXML
    private void mainUiButtonAction(ActionEvent event) {
    try{
    new MainUI().setVisible(true);
    catch(Exception ex){                 
    }

  • Problems with enumerated type and DataSocket

    I am publishing an enumerated type variable using DataSocket write and I am having problems subscribing to this with other clients on the network. I can get the program to work ok if I replace the enumerated type with a straight numeric or a Text Ring for example. Is there anything special I should be looking out for when using enumerated types in this type of application.
    Thanks Kelly

    Updating to the latest version of LabVIEw (6.0.2) should correct this problem:
    http://digital.ni.com/softlib.nsf/websearch/F983BDA17B8F401B862569EC005A11C2
    Also, I would suggest updating to the latest version DataSocket:
    http://digital.ni.com/softlib.nsf/web%2Fall%20software?OpenView&Start=1&Count=500&Expand=6#6
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • Is there an equivalent statement in Java for this PL/SQL stmt?

    Hi,
    I want to know if there is an equivalent statement
    in java for this PL/SQL statement:
    IF strTok IN('COM-1','COM-2','COM-3') Then
    /* Do Something */
    End If;
    I tried using : // This is giving me errors..
    if (strTok.equals(("COM-1") || ("COM-2") || ("COM-3") ) )
    /* Do Something */
    The above Java code is giving me errors.
    Any Help to reduce the number of steps for comparison
    is appreciated.
    thanks in adv
    Sharath

    Something like
    if (strTok.equals("COM-1") ||
        strTok.equals("COM-2") ||
        strTok.equals("COM-3") )Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Create a table in SQL with datatype equivalent to LongBlob

    I have a mySQL or phpMyadmin table (nor sure) (with longblob fields) that I want to convert to SQL Server.
    Here is a link to a Rar with two files, the 'ORIGINAL CODE.sql' is the original code sample and the 'NEW_SQL_CODE.sql' is the code I am writing in SQL to create a database.
    Click to download the two files.
    I fail to make the insert in the 'NEW_SQL_CODE.sql', it says (translated from spanish) something like "The binary data will be truncated"
    INSERT INTO inmuebles_fotos (ci_inm, pos, foto, mini, comentario, inet, impr_cartel, impr_visita) VALUES
    (6, 0, 0xffd8ffe000104a46494600010100000100010...etc...
    I don’t know how if I have defined the wrong data type (image) equivalent to the MySQL LongBlob. All I want to do is to make that insert in SQL and save that image as jpg if possible. I don't know if it's not posible in SQL and can only
    be done in MySQL.
    Thanks for any help.

    The original table is not mine; I am just trying to save the images as .jpg in hard drive.
    Here is the original table I have that has 500Mb in pictures, in the sample there is only 1 picture:
    CREATE TABLE IF NOT EXISTS `inmuebles_fotos` (
    `ci_inm` int(10) unsigned DEFAULT NULL,
    `pos` smallint(6) DEFAULT NULL,
    `foto` longblob,
    `mini` longblob,
    `comentario` varchar(100) DEFAULT NULL,
    `inet` tinyint(3) unsigned DEFAULT '0',
    `impr_cartel` smallint(6) DEFAULT '0',
    `impr_visita` smallint(6) DEFAULT '0'
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    And here is the equivalent table in SQL that I am trying to create to import al registers so I can save the pictures from SQL Server that is what we use here.
    CREATE TABLE [dbo].[inmuebles_fotos2](
    [ci_inm] [int] NULL,
    [pos] [int] NULL,
    [foto] [image] NULL,
    [mini] [image] NULL,
    [comentario] [varchar](1) NULL,
    [inet] [int] NULL,
    [impr_cartel] [int] NULL,
    [impr_visita] [int] NULL
    Sorry for the trouble, I am trying everything I get my hands on until I get to save those images in “0x1234567890ABCDE…….” Format.
    I'll try anything you sugest me but I have only use SQL Server so that's why I'm trying this road first.
    Thanks for your help.

  • Best app to give equivalent of microsoft office

    I use a PC with office and need to find the equivalent to use on MacBook which is the best please?

    How about?
    http://www.microsoft.com/MAC

  • Null value in List Binding (enumeration mode)

    Hi,
    how can I declare a NULL value in a List binding with enumeration mode?
    A user should be able to select an empty entry in a combobox to update an attribute with a null value.
    I'm using JDev9052 and JClient.
    Any hints?
    Thanks,
    Markus

    Adding '-1' in JComboBox (addItem(new Integer(-1))) or in the control binding does not change the picture. Sorry.
    While play with different List bindings I have discovered that a Button LOV Binding works when using a "select * UNION select null from dual" view object. It does not work with a Combobox LOV binding. Why?
    Still, my problem List binding in enumeration mode (with Combobox) is unsolved. any hints or samples?
    My current combobox binding:
    <DCControl
    id="Job"
    DefClass="oracle.jbo.uicli.jui.JUComboBoxDef"
    SubType="DCComboBox"
    BindingClass="oracle.jbo.uicli.jui.JUComboBoxBinding"
    IterBinding="EmpView1Iterator"
    ApplyValidation="false"
    isDynamic="false"
    ListOperMode="0"
    StaticList="true"
    Editable="false" >
    <AttrNames>
    <Item Value="Job" />
    </AttrNames>
    <ValueList>
    <Item Value="ANALYST" />
    <Item Value="CLERK" />
    <Item Value="MANAGER" />
    <Item Value="PRESIDENT" />
    <Item Value="SALESMAN" />
    <Item Value="-1" />
    </ValueList>
    </DCControl>
    My current Button LOV binding:
    <DCControl
    id="Job2"
    DefClass="oracle.jbo.uicli.jui.JULovButtonDef"
    SubType="DCLovButton"
    BindingClass="oracle.jbo.uicli.jui.JULovButtonBinding"
    IterBinding="EmpView1Iterator"
    DTClass="oracle.adf.dt.objects.JUDTCtrlListLOV"
    ApplyValidation="false"
    isDynamic="false"
    ListOperMode="0"
    ListIter="JobListView1Iterator" >
    <AttrNames>
    <Item Value="Job" />
    </AttrNames>
    <ListAttrNames>
    <Item Value="Job" />
    </ListAttrNames>
    <ListDisplayAttrNames>
    <Item Value="Job" />
    </ListDisplayAttrNames>
    </DCControl>

  • MM03 equivalent DS for BW

    Hi, what is the equivalent DS in LBWE to capture MM03 data for sales org 2.  How do we make a report in BW for this requirement.  I need the DS for this.
    Thanks,
    Radha

    Hi,
    You can try to use datasource 0MAT_SALES_ATTR...
    If you would like to create queries based on characteristic values you should first create it as InfoProvider (in RSA1 go to InfoProvider and from menu choose something like "Create characteristic as...").
    Krzys

Maybe you are looking for

  • My powermac g5's hard drive failed, so I got a new hard drive with osx 10.5

    I got a new hard drive for my powermac g5 after the other one failed. This one has osx 10.5 on it, I'm just wondering how im meant to install it, I'm not sure whether it will work straight away or whether I will have to install something or other wit

  • Signed Applet problems in Vista + JMF

    Hi All, I'm new to Java Applet programming. I wrote an application which works as a VoIP Client in a webpage (Using JMF). Its working very fine in allmost all Windows XP machines. But not in Windows Vista machines. In Vista i'm getting the following

  • Problems during import BW structure - Don't view the queries

    Hello! I have a problem when import the structure of BW 7.0 with xmla file in OBIEE+. The version of OBIEE is 10.1.3.4. When I do the importation, I don't see the queries created on BW, only the infocubes. But the queries is associate to infocube. Ca

  • Apps crashing on ipod touch..? (4th gen)

    I've had this problem for two weeks. I try to open the apps, it looks as if it's going to open, then crashes and the device returns to homescreen. Fair enough, I've had this problem before. All of those times, however, I simply turned the iPod off an

  • Apple Digital Camera RAW Support 2.2. update

    After todays Apple Security Update 2008-007 the Apple Digital Camera RAW Support 2.2. update finally works correctly and the data can be aquired via card reader. Message was edited by: jdonath