JDBC metadata problem

I have found an inconsistency when querying JDBC metadata. When using the DataBaseMetadata.getTypeInfo() method no line is returned for java.sql.Types.DECIMAL (numeric value 3). So it seams, that Oracle is not supporting this type. But when I'm querying metadata for table columns (DataBaseMetadata.getColumns) or user types (DataBaseMetadata.getUDTs) I can get java.sql.Types.DECIMAL as a value for column datatype.
I tried this with JDBC driver version 9.0.2.0.0 (that's what the manifest says) / 9.2.0.3.0 (that's what the DataBaseMetadata.getDriverVersion says) on JDK 1.3.1_06 and Oracle 9i Enterprise Release 9.0.1.0.0 server.
Am I missing something or is this a bug?

I have found an inconsistency when querying JDBC metadata. When using the DataBaseMetadata.getTypeInfo() method no line is returned for java.sql.Types.DECIMAL (numeric value 3). So it seams, that Oracle is not supporting this type. But when I'm querying metadata for table columns (DataBaseMetadata.getColumns) or user types (DataBaseMetadata.getUDTs) I can get java.sql.Types.DECIMAL as a value for column datatype.
I tried this with JDBC driver version 9.0.2.0.0 (that's what the manifest says) / 9.2.0.3.0 (that's what the DataBaseMetadata.getDriverVersion says) on JDK 1.3.1_06 and Oracle 9i Enterprise Release 9.0.1.0.0 server.
Am I missing something or is this a bug?

Similar Messages

  • MSSQLServer jdbc connect problem on ODI 11G R2

    I have a MS SQL Server jdbc connect problem on ODI 11G R2 / Windows server 2008 64 bits.
    Tried, one by one, all versions of Microsoft drivers.
    Sqljdbc4.jar copied to : %appdata%\odi\oracledi\userlib\
    The Topology connect syntax is :
    driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    URL : jdbc:sqlserver://<host>:1433
    => All the topology tests end with time-outs.
    Installed 10G ODI.
    Works with 1.4 java and sqljdbc.jar version 2 jdbc driver.
    Times out with version 3 and/or Sqljdbc4.jar + JAVA_HOME & ODI_JAVA_HOME set to 1.6 path.
    also tried, with no success (time-outs) on either 10g or 11g :
    com.inet.tds.TdsDriver
    jdbc:inetdae7://<host>:1433?database=<DB>
    same results for :
    net.sourceforge.jtds.jdbc.Driver
    jdbc:jtds:sqlserver://<host>:1433
    Any suggestions for a fix?
    Many thanks in advance.

    Hello,
    ODI (11g) Studio is certified on Windows 32 bit only, not on 64bit.
    However you may still install it and configure ODI Studio to run with a 32 bit java.
    Details pls see Master Note For ODI 11g Install Issues And Questions (Doc ID 1214428.1).
    To connect to SQL Server:
    # Check and make sure the authentication mode of your Microsoft SQL Server Server is set to "SQL Server and Windows" or "Mixed", otherwise Oracle Data Integrator (ODI) is unable to connect to the database.
    # Before you create the Oracle Data Integrator (ODI) Dataserver in Topology Manager > Physical Architecture, stop all ODI processes, and place the JDBC Driver file in the ODI's userlib and "/drivers" folder.
    For ODI Studio (Local No Agent)
    %APPDATA%\odi\oracledi\userlib
    %APPDATA% is the Windows Application Data directory for the user (usually C:\Documents and Settings\<user>\Application Data).
    Standalone Agent
    ODI_HOME\oracledi\agent\drivers
    Note: If you decide to use the DataDirect driver that comes with ODI 11g install/ embedded in ODI 11g
    weblogic.jdbc.sqlserver.SQLServerDriver
    Then you don't need to worry about this step.
    # Make sure that the database is the default database of the user account employed by ODI for connection, and that the password is correct.
    # Verify (in your Microsoft SQL Server Server network configuration) that TCP/IP has been enabled on port 1433.
    For more details see How To Set Up JDBC Driver Connections For The Microsoft SQL Server For ODI (Doc ID 423914.1)
    If you try sqljdbc.jar, you need to configure ODI_JAVA_HOME to jdk1.5
    sqljdbc4.jar, jdk1.6 (since ODI 11g requires jdk1.6, I'd suggest sqljdbc4.jar)
    More see Compatibility Matrix For Java Machines And JDBC Drivers Used With ODI (Doc ID 807235.1)
    Hope that helps other people who run into this,
    Edited by: user742480 on Apr 4, 2011 12:06 PM

  • ITunes will not import some .mp4 content, metadata problem?

    I have been importing movies and TV shows for years into iTunes so that my disabled son can watch them on his AppleTV but lately I have been having a problem getting some to go into iTunes.  This batch is part of season 9 and 10 of Smallville.  I imported about half of the two seasons no problem but the other half will not import.  I have ripped all my movies and TV episodes off of disks that I own using Handbreak and WinX DVD Ripper for Mac and it has worked just fine for over 1050 movies and 6200 TV episodes and I was able to import all of season 9 and 10 of Smallville into my laptop's iTunes no problem but on my son's iMac no luck.  Both computers are running Mac OS 10.6.8 and iTunes 10.6.1(7) and all content is on two 3TB external hard drives.  That is two external drives for the laptop and two for the iMac.  After burning, content on one external drive is copied to the other computer's external drive and imported to iTunes on that computer. This way I have a backup copy of all my iTunes video content and two completely independent iTunes and AppleTV's.  But on my son's computer 16 episodes will not go in.  I "command O" like normal but no import bar is noted and no content can be found.  I believe that this problem is due to metadata content.  I am also have a little trouble getting some TV content to switch from Music or Movie Media Kind to TV Media Kind and I know that this is a metadata problem.  Also some of the episodes have been in iTunes before either from the Apple Store or ripped and then deleted for one reason or the other.  I therefore believe that there is a file in iTunes that is telling the program that the episodes I now want to import are already in iTunes and therefore should not go in twice.  I have tried changing the episode names and importing, no luck and I even edited an episode using MPEG Streamclip, removing some content, and then resaving it under another name, no luck either.  Any ideas would be helpful.  I know the Media Kind problem has been address before but now I cannot find it so a link to that discussion would also be helpful.  Thank you for any help.

    I have the same issue here. My daughter has an iPod Touch4 and I have been importing mp4's with no problems up until the last iTunes update. Now I get nothing. No message, not activity, nothing. Either this is a new bug in iTunes or they have now eliminated the import ability.
    I am sick and tired of apple and their hand-holding, big-brother coddling. My daughters iPod is the last Apple product we have and now I think it's time to totally part ways with Apple and go all in with Android. We have already converted all our phones from Apple to Android. The Samsung Galaxy Player looks like a great replacement to the iPod.

  • Metadata problem with JSP/servlet application

    Hi,
    I developed a JSP/servlet test application that makes
    use of kodo 2.2.3 STANDARD EDITION for its persitence.
    I successfully compile and annotate the application.
    I am also able to successfully generate the db
    schema with schematool.
    Unfortunately, when I run the application using
    Resin 2.0.2, Kodo is unable to initialize properly.
    Initially it was not able to find "system.prefs" file.
    I fixed that by putting "system.prefs" in WEB-INF\classes.
    Unfortunately, Kodo is still unable to initialize and
    gives the following message:
    The system could not initialize; the following registered
    persistent types are missing metadata
    or have not been enhanced:
    [class com.dpov.purchaseorder.PurchaseOrder,
    class com.dpov.catalog.Product,
    class com.dpov.uidgen.counter.Counter,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
    class com.dpov.pricelist.PriceInfo,
    class com.dpov.pricelist.PriceList,
    class com.dpov.catalog.Category,
    class com.dpov.lineitem.LineItem,
    class com.dpov.dealer.Dealer,
    class com.dpov.user.User,
    class com.dpov.customer.Customer].
    I use "system.jdo" to describe metadata for the enhancer.
    I tried to put it both in WEB-INF\lib and WEB-INF\classes but
    it still fails.
    Please note that:
    1) my classpath variable is not set
    2) my application's class file are in WEB-INF\classes
    3) kodo jars are in WEB-INF\lib
    4) mysql jdbc driver is in WEB-INF\lib
    5) system.prefs is in WEB-INF\classes
    6) system.jdo is in WEB-INF\classes
    Thanks in advance,
    Andrea
    system.prefs
    <?xml version="1.0"?>
    <prefs>
    <kodo-license-key>VALID KEY!</kodo-license-key>
    <db>
    <username></username>
    <password></password>
    <url>jdbc:mysql://localhost/kodo</url>
    <driver>org.gjt.mm.mysql.Driver</driver>
    <dictionary>
    com.solarmetric.kodo.impl.jdbc.schema.dict.MySQLDictionary
    </dictionary>
    <warn-on-persistent-type-failure>true</warn-on-persistent-type-failure>
    </db>
    <tm-location>java:/TransactionManager</tm-location>
    </prefs>
    system.jdo
    <?xml version="1.0"?>
    <jdo>
    <package name="com.dpov.uidgen.counter">
    <class name="Counter" />
    </package>
    <package name="com.dpov.customer">
    <class name="Customer" />
    </package>
    <package name="com.dpov.user">
    <class name="User" />
    </package>
    <package name="com.dpov.dealer">
    <class name="Dealer" />
    </package>
    <package name="com.dpov.catalog">
    <class name="Product" />
    </package>
    <package name="com.dpov.catalog">
    <class name="Category" />
    </package>
    <package name="com.dpov.catalog.dao.jdo">
    <class name="CategoryHierarchyDAO">
    <field name="categories">
    <collection element-type="com.dpov.catalog.Category"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.catalog.dao.jdo">
    <class name="CategoryHierarchyEntry">
    <field name="attributeValues">
    <map key-type="String" value-type="CategoryHierarchyEntry"/>
    </field>
    <field name="productIds">
    <collection element-type="String"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.lineitem">
    <class name="LineItem" />
    </package>
    <package name="com.dpov.purchaseorder">
    <class name="PurchaseOrder">
    <field name="lineItems">
    <collection element-type="com.dpov.lineitem.LineItem"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.pricelist">
    <class name="PriceInfo" />
    </package>
    <package name="com.dpov.pricelist">
    <class name="PriceList">
    <field name="priceInfos">
    <map key-type="String" value-type="PriceInfo"/>
    </field>
    </class>
    </package>
    </jdo>

    Hi,
    I fixed my problem by setting the system wide variable (WindowsXP)
    CLASSPATH to r:\\dealershop\\WEB-INF\\classes.
    Thanks,
    Andrea
    andrea costantinis wrote:
    Hi,
    I developed a JSP/servlet test application that makes
    use of kodo 2.2.3 STANDARD EDITION for its persitence.
    I successfully compile and annotate the application.
    I am also able to successfully generate the db
    schema with schematool.
    Unfortunately, when I run the application using
    Resin 2.0.2, Kodo is unable to initialize properly.
    Initially it was not able to find \"system.prefs\" file.
    I fixed that by putting \"system.prefs\" in WEB-INF\\classes.
    Unfortunately, Kodo is still unable to initialize and
    gives the following message:
    The system could not initialize; the following registered
    persistent types are missing metadata
    or have not been enhanced:
    [class com.dpov.purchaseorder.PurchaseOrder,
    class com.dpov.catalog.Product,
    class com.dpov.uidgen.counter.Counter,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
    class com.dpov.pricelist.PriceInfo,
    class com.dpov.pricelist.PriceList,
    class com.dpov.catalog.Category,
    class com.dpov.lineitem.LineItem,
    class com.dpov.dealer.Dealer,
    class com.dpov.user.User,
    class com.dpov.customer.Customer].
    I use \"system.jdo\" to describe metadata for the enhancer.
    I tried to put it both in WEB-INF\\lib and WEB-INF\\classes but
    it still fails.
    Please note that:
    1) my classpath variable is not set
    2) my application\'s class file are in WEB-INF\\classes
    3) kodo jars are in WEB-INF\\lib
    4) mysql jdbc driver is in WEB-INF\\lib
    5) system.prefs is in WEB-INF\\classes
    6) system.jdo is in WEB-INF\\classes
    Thanks in advance,
    Andrea

  • MapViewer metadata problem - accessing spatial data in a different schema.

    I have a MapViewer application that uses data from three different schemas.
    1. Dynamic Themes come from schema A.
    2. Static Themes come from schema B.
    3. A newly added static theme in B whose data comes from schema C.
    The mapviewer datasource points to schema B where the static themes, data and metadata are defined while the dynamic themes have their own datasource specified as part of addJDBCTheme(...).
    To get the newly added map to work I've had to add a view in schema B that points to C instead of referencing directly the table and I've had to add the metadata twice, once for schema B and once for schema C.
    If I put the metadata in just one of the two schemas I get the following errors.
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] cannot find entry in ALL_SDO_GEOM_METADATA table for theme: AMBITOS_REST
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] java.sql.SQLException: Invalid column index
    OR
    08/11/21 13:53:39 ERROR [oracle.sdovis.theme.pgtp] java.sql.SQLException: ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    It's not a big deal but I'd like to know if anyone else has has similar problems.
    Saludos,
    Lew.
    Edited by: Lew2 on Nov 21, 2008 6:42 AM

    Hi Lew,
    if you are using a recent version (10.1.3.1 or later) there is no need to use a view and to create the metadata in both schemas.
    You need to grant selection on tables between the schemas.
    You can try the following. Assume you have the MVDEMO schema (from MapViewer kit) and SCOTT schema.
    1) grant select on MVDEMO Counties table to SCOTT
    SQL> grant select on counties to scott;
    2) Now you are ready to create a predefined theme in schema SCOTT using the MVDEMO Counties table.
    - Open MapBuilder and loads the SCOTT schema.
    - On the Data navigator (bottom left tree), go to Geometry tables and you should see the MVDEMO node and the COUNTIES node inside it.
    - Start a wizard to create a geometry theme based on this Counties table.
    - At the end you should see that the base table name is MVDEMO.COUNTIES. Therefore MapViewer will use the metadata in MVDEMO schema and there is no need to replicate it in SCOTT schema.
    Joao

  • Oracle 8.1.5 JDBC driver problem with LONGVARCHAR

    Hi, I'm having problem with 8.1.5 release on Solaris with the
    JDBC type 4 driver (thin). If I create the following table
    create table test1 (col1 NUMBER, col2 LONG);
    Using JDBC driver to insert into the second column any string
    longer than 4000 characters causing run time exception. The type2
    driver works fine, but type2 is slow.
    String sql = "insert into test1 (col1, col2) values (1099,?)";
    PreparedStatement stmt ;
    stmt = conn.prepareStatement(sql);
    // create a string with very long value , bigger than 4096
    stmt.setString(1,string);
    stmt.executeUpdate();
    runtime exception:
    java.sql.SQLException: Data size bigger than max size for this
    type
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.check_error(Compiled
    Code)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setItem(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setString(Compiled
    Code)
    at testi.main(Compiled Code)
    Any help is appreciated.
    Thanks
    Steve
    null

    Post the full stacktrace here
    Also you might want to post jdbc related questions to weblogic.developer.
    interest.jdbc
    Kumar
    DreamNEON wrote:
    Hello,
    the NSAPI integration works, also the JSP files.
    But I have still problems with the Jdriver for my Oracle 8.1.5.
    I get the message :
    Failed to invoke startup class
    weblogic.jdbc.common.internal.JdbcStartup=weblogic.jdbc.common.internal.JdbcStartup
    when the WebLogic Server is started.
    Any ideas or hints about that?
    Thanks in advance
    Armin

  • Adobe CS3 Bridge - Metadata Problem

    Hello,
    Alot of my images (JPGs) seem to be losing their metadata, for example, if I keyword a bunch of pictures in bridge and save them. I go back the next day, and they are missing? Also when uploading to a website, if I put in copyright like this:
    © Copright Name 2008
    it almost always appears like this when on site:
    Á© Copright Name 2008
    Does anyone have any idea how, and why this is happening, and if there is a way to resolve this incredibly annoying problem.
    If it's any relevance, I am seperating keywords with commas.

    It should be possible to batch remove that using a metadata template where you set that particular field to be empty and then append that template to all your files (and of course, test on some random pics before doing something like this on all your images)

  • List view threshold and columns manage metadata problems

    Hi
    We have problem in our company since we have more files in library than is set in List view Threshold.
    I have created index on column "year" and create view filter: Year is equal 2015.
    and I get famous error: this view cannot be displayed because....
    I haven`t find any limitations on column type: manage metadata?

    Hi,
    As I understand, you encountered the issue after you created view filter.
    Every column type has the default number that can be created. You should go to check the number of your column created is less than the number by default.
    Per my test, I can achieve it without exceeding list view threshold.
    Check things below:
    1. You can increase the number of the list view threshold, and after that, you can try again to see the same situation will occur.
    2. Go to create another managed metadata column “year”, and create index on column "year", and create view filter in the same list to see the issue will occur.
    3. Check ULS log to see the details about the cause of the issue.
    Best regards,
    Sara Fan

  • Premiere Pro CS5.5 Mac - Major Metadata Problems

    Hi...
    I am having major problems with the Metadata system in Premiere Pro CS5.5
    I have created a custom scheme and added the following property "Key" and set it to have a boolean value (Check Mark)
    My Metadata display correctly displays the "Key" property and I can check it. Just like expected.
    I will now apply it to the clip(s) in need of that meta property.
    In the project column the property is also show correctly...
    All good so far but now comes the two major problems
    PROBLEM 1
    1) I have about 300 clips in the project panel
    2) If I click the column header I can sort accordingly
    3) Clicking name or Labels will immediately sort correctly. 1 Second tops.
    4) If I click the column header of my custom propert "Key" I get the SWOD and it takes about 120 seconds for Premiere to sort adhering to the Key Column.
    2 minutes for that is a VERY long time compared to sorting by name...
    Could this be a bug or am I doing something wrong...
    PROBLEM 2
    In the project panel's search field I will enter "Key" but nothing will appear... At least that is what I thought.
    It took more than ONE HOUR for Premiere's search results to be able to identify that a clip had gotten that property checked. (Clicking the Clip immediately reflects that it has been checked)
    I even timed it. Ckecked the Key property for 4 new clips which did not have the meta applied to them.
    In the search field I entered 'Key" but only the clip which had had the Key meta tagged since 1 hour would appear.
    I waited another hour and now those very 4 clips also appear in the search field. The same goes for the "Good" meta boolean which is NOT a custom field.
    I saved the project in between quit Premiere and re-launched but THAT did NOT help PPRO find that Property in the search field.
    As I said, it takes about 1 hour for Premiere to be able to included those metadata in the search results.
    Funny thing is, if I enter 'true' which is the boolean text-string for a checked property the results appear immediately. But there is NOT much use in having ALL boolean fields appear that are checked.
    I welcome that adobe implemented metadata across their apps but ELEGANT is something entirely different.
    Could anyone shed some light on this ?
    Thanks

    Hi...
    I am having major problems with the Metadata system in Premiere Pro CS5.5
    I have created a custom scheme and added the following property "Key" and set it to have a boolean value (Check Mark)
    My Metadata display correctly displays the "Key" property and I can check it. Just like expected.
    I will now apply it to the clip(s) in need of that meta property.
    In the project column the property is also show correctly...
    All good so far but now comes the two major problems
    PROBLEM 1
    1) I have about 300 clips in the project panel
    2) If I click the column header I can sort accordingly
    3) Clicking name or Labels will immediately sort correctly. 1 Second tops.
    4) If I click the column header of my custom propert "Key" I get the SWOD and it takes about 120 seconds for Premiere to sort adhering to the Key Column.
    2 minutes for that is a VERY long time compared to sorting by name...
    Could this be a bug or am I doing something wrong...
    PROBLEM 2
    In the project panel's search field I will enter "Key" but nothing will appear... At least that is what I thought.
    It took more than ONE HOUR for Premiere's search results to be able to identify that a clip had gotten that property checked. (Clicking the Clip immediately reflects that it has been checked)
    I even timed it. Ckecked the Key property for 4 new clips which did not have the meta applied to them.
    In the search field I entered 'Key" but only the clip which had had the Key meta tagged since 1 hour would appear.
    I waited another hour and now those very 4 clips also appear in the search field. The same goes for the "Good" meta boolean which is NOT a custom field.
    I saved the project in between quit Premiere and re-launched but THAT did NOT help PPRO find that Property in the search field.
    As I said, it takes about 1 hour for Premiere to be able to included those metadata in the search results.
    Funny thing is, if I enter 'true' which is the boolean text-string for a checked property the results appear immediately. But there is NOT much use in having ALL boolean fields appear that are checked.
    I welcome that adobe implemented metadata across their apps but ELEGANT is something entirely different.
    Could anyone shed some light on this ?
    Thanks

  • JDBC TableModel problem with setValueAt

    Hello to everyone. I have problem when I change value at cell in Table. My model makes update in DB, but in GUI the change is not visible. The change gets visible only when I reopen the Table.
    public class CustomTableModel extends AbstractTableModel implements Serializable
        int                  dateTime = Types.DATE;
        Connection                con = null;
        ResultSet                  rs = null;
        ResultSetMetaData  rsMetaData = null;
        int                numColumns;
        String[]          columnNames = null;
        boolean           isUpdatable;
        Vector                   rows = new Vector();
        public CustomTableModel(Connection connect, ResultSet rset, String[] strl )
         try
             con = connect;
          String[] sNames = strl;
             rs = rset;
             rsMetaData = rs.getMetaData();
             numColumns = rsMetaData.getColumnCount();
             columnNames = new String[numColumns];
          int rowIndex;
          int columnIndex;
           if (rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE)
              isUpdatable = true;
             else
              isUpdatable = false;
             for (int i = 0; i < numColumns; i++)
        if (sNames==null){
              columnNames[i] = rsMetaData.getColumnLabel(i+1);
        else
          columnNames = sNames;
             while(rs.next())
              Vector tempRow = new Vector(numColumns);
              for (int i = 0; i < numColumns; i++)
                  switch(rsMetaData.getColumnType(i+1))
                  .............. TYPES....
             } // end for loop
              rows.add(tempRow);
             } // end while loop
         }My method setValueAt
    public void setValueAt(Object aValue, int rowIndex, int columnIndex)
         try
            Object oldValue = getValueAt(rowIndex,columnIndex);
             if (oldValue == null && aValue == null)
              return;
             // can use equals() only if oldValue is not null
             if (oldValue != null)
              if (oldValue.equals(aValue))
                  return;
             // JTable is 0 based while ResultSet is 1 based
             rs.absolute(rowIndex+1);
             updateResultSet(rs, aValue, rowIndex, columnIndex);
             rs.updateRow();
             con.commit();
             Vector aRow = (Vector)rows.elementAt(rowIndex);
                aRow.setElementAt(aValue, columnIndex);
           fireTableCellUpdated(rowIndex, columnIndex);
         catch (SQLException ex)
             ExceptionEvent event = new ExceptionEvent(this, ex.getMessage());
             fireExceptionGenerated(event);
             try
              con.rollback();
             catch (SQLException ex2)
              event = new ExceptionEvent(this, ex2.getMessage());
              fireExceptionGenerated(event);
         catch (Exception ex)
             ExceptionEvent event = new ExceptionEvent(this, ex.getMessage());
             fireExceptionGenerated(event);
        }Thanks in advance.

    import java.io.*;
    import java.sql.*;
    import java.text.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableModelDemo extends javax.swing.JFrame {
        public TableModelDemo() {
            initComponents();
            connectDatabase();
            CustomTableModel model = new CustomTableModel();
            model.init(conn,rs,null);
            jTable1.setModel(model);
        private void connectDatabase(){
            try{
                DriverManager.registerDriver(new com.sybase.jdbc2.jdbc.SybDriver());
            }catch (Exception ex){
                ex.printStackTrace();
            conn=null;
            try{
                conn = DriverManager.getConnection("jdbc:sybase:Tds:prdfs4:2638","dba","sql");
            }catch (Exception ex){
                System.out.println("Connection refused");
            try {
                if(conn!=null){
                    Statement stmt = conn.createStatement();
                    String query ="SELECT ANA_LED_BASE_FORGN_CURY, ANA_AXIS_CODE, ANA_ACC_NUM, ANA_LED_TXT FROM ana_ledger " +
                            "where CMPY_CODE='06-LV   ' and JRNL_CODE='SFA  ' and ANA_LED_DOC_NUM=0008170";
                    rs = stmt.executeQuery(query);
            } catch (SQLException sqe) {
                String message = sqe.getMessage();
                JOptionPane.showMessageDialog( null, message );
        private void initComponents() {
            jScrollPane1 = new javax.swing.JScrollPane();
            jTable1 = new javax.swing.JTable();
            jToolBar1 = new javax.swing.JToolBar();
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("change value at cell in Table");
            jScrollPane1.setViewportView(jTable1);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
            jToolBar1.setFloatable(false);
            jButton1.setText("change value at cell in Table");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jToolBar1.add(jButton1);
            getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-790)/2, (screenSize.height-327)/2, 790, 327);
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            String val = JOptionPane.showInputDialog("change value at cell in Table","TEST,1,1");
            String val2[] = val.split(",");
            jTable1.setValueAt( val2[0],Integer.parseInt(val2[1]),Integer.parseInt(val2[2]) );
        public static void main(String args[]) {
                    new TableModelDemo().setVisible(true);
        private javax.swing.JButton jButton1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTable jTable1;
        private javax.swing.JToolBar jToolBar1;
        private ResultSet rs ;
        private Connection conn;
    class CustomTableModel extends DefaultTableModel implements Serializable {
        int                  dateTime = Types.DATE;
        Connection                con = null;
        ResultSet                  rs = null;
        ResultSetMetaData  rsMetaData = null;
        int                numColumns;
        String[]          columnNames = null;
        boolean           isUpdatable;
        Vector                   rows = new Vector();
        public void init(Connection connectToDatabase, ResultSet rset, String[] strl ) {
            try {
                con = connectToDatabase;
                String[] sNames = strl;
                rs = rset;
                rsMetaData = rs.getMetaData();
                numColumns = rsMetaData.getColumnCount();
                columnNames = new String[numColumns];
                int rowIndex=0;
                int columnIndex;
                if (rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE) {
                    isUpdatable = true;
                } else {
                    isUpdatable = false;
                for (int i = 0; i < numColumns; i++) {
                    if (sNames==null){
                        columnNames[i] = rsMetaData.getColumnLabel(i+1);
                    } else {
                        columnNames = sNames;
                while(rs.next()) {
                    Object[] rowData = new Object[numColumns];
                    addRow( rowData );
                    Vector tempRow = new Vector(numColumns);
                    for (int i = 0; i < numColumns; i++) {
                        if( rowIndex==0 ){
                            addColumn( columnNames[i] );
                        setValueAt( rs.getString(i+1), rowIndex, i );
                        //                    switch(rsMetaData.getColumnType(i+1))
                        //                    .............. TYPES....
                    } // end for loop
                    rows.add(tempRow);
                    rowIndex++;
                } // end while loop
            }catch(Exception ex){
                ex.printStackTrace();
        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
            super.setValueAt( aValue, rowIndex, columnIndex );
            try {
                Object oldValue = getValueAt(rowIndex,columnIndex);
                if (oldValue == null && aValue == null) {
                    return;
                // can use equals() only if oldValue is not null
                if (oldValue != null) {
                    if (oldValue.equals(aValue)) {
                        return;
                // JTable is 0 based while ResultSet is 1 based
                //            rs.absolute(rowIndex+1);
                //            updateResultSet(rs, aValue, rowIndex, columnIndex);
                //            rs.updateRow();
                //            con.commit();
                //        Vector aRow = (Vector)rows.elementAt(rowIndex);
                //        aRow.setElementAt(aValue, columnIndex);
                //            fireTableCellUpdated(rowIndex, columnIndex);
                //        } catch (SQLException ex) {
                //            ExceptionEvent event = new ExceptionEvent(this, ex.getMessage());
                //            fireExceptionGenerated(event);
                //            try {
                //                con.rollback();
                //            } catch (SQLException ex2) {
                //                event = new ExceptionEvent(this, ex2.getMessage());
                //                fireExceptionGenerated(event);
            } catch (Exception ex) {
                //                    ExceptionEvent event = new ExceptionEvent(this, ex.getMessage());
                //                    fireExceptionGenerated(event);
    }

  • STRUTS - JDBC connection problem

    im using tomcat 5.5.9, jdk 1.5, oracle database...
    � have a project in struts...
    my project works with my compiler with no problem...
    *i setup tomcat on C:\jakarta-tomcat-5.5.9
    and � made these setting for tomcat:
    � added these strings to my CLASSPATH
    --C:\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar
    --C:\jakarta-tomcat-5.5.9\common\lib\jsp-api.jar
    after � deployed my project under tomcat there was a "classes12.zip" file under this path:
    C:\jakarta-tomcat-5.5.9\webapps\BILGISU\WEB-INF\lib
    � changed it to class.jar
    also � have other .jars under the same path above.
    these jars are:
    classes12.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-dbcp.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-lang.jar
    commons-logging.jar
    commons-pool.jar
    commons-validator.jar
    jakarta-oro.jar
    jdbc2_0-stdext.jar
    struts.jar
    struts-legacy.jar
    THE PROBLEM IS:
    my index page is a "login" page..
    i can open the login page under tomcat.
    but when � enter the username and password, page says it is wrong username or password although these are true parameters...
    i think i still have a connection problem but � dont know how to solve...
    MY SEARCHES SAYS:
    you have to reconfigure "C:\jakarta-tomcat-5.5.9\conf\server.xml" like that:
    <Resource name="jdbc/myoracle"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:[email protected]:1521:mysid"
    username="scott"
    password="tiger"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"/>
    Resource name="jdbc/myoracle" ->HERE WHAT IS "myoracle"??? DOES IT BELONG TO MY PROJECT?
    you have to reconfigure "C:\jakarta-tomcat-5.5.9\conf\web.xml" like that:
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    will i write this to my web.xml
    and what is "auth=Container" here???????
    thanks in advance
    yasin

    ONE MORE QUESTION
    Im defining the datasource in my "struts-config.xml"
    do i have to define them again in "tomcat/conf/server.xml" ...

  • JSP + JDBC + MySql Problem (Tomcat 4.1)

    I'm completely helpless... whenever I try to retrieve stuff from the db (using a jsp page), I get errors that don't even make sense.
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));if I try doing the above, I get a "ServletException : Before start of result set" error that supposedly occurred at this line of the generated servlet:
    if (pageContext != null) pageContext.handlePageException(t);---------------
    If i try this:
    ResultSet rsSec = stmt.executeQuery("SELECT * FROM newsSecTbl");
    rsSec.beforeFirst();  //<-- Even if I don't have this line the result does not change
      out.println(rsSec.next());
      while (rsSec.next()) { ... }I the while loop is never initiated, because rsSec.next() is false... kind of weird if you ask me, I even put two entries into the table to make sure the cursor wasnt at the first record and saying there was no second one (which would have been right if there were only one record).
    I would be very grateful if someone could help me out with this. I've never done any db programming with Java yet, so I dont have a clue what Im doing. By the way, I'm using MySql (indicated in the title) and the server was running and available when I ran the above code.
    Cheers,
    Tom

    You can't do this:
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));The ResultSet you get back is a database cursor that doesn't point to the first row yet. The correct idiom is:
    String sql = "SELECT * FROM newsTbl WHERE articleID = 1";
    ResultSet result = stmt.executeQuery(sql);
    String articleTitle = "";
    while (result.next())
       title = result.getString("articleTitle");
    result.close();
    stmt.close();If you've never done DB programming before, I'd recommend that you click on the Tutorials link to the left and go through the JDBC tutorial carefully. You'll save yourself a lot of grief.
    Another good idea would be to separate out all your database code into at least one separate object, independent of the servlet. That way you can test and develop it off to the side until it's 100% solid. Then your servlet can simply instantiate one and use it. All your problems from that point forward will be servlet issues, because you'll know that your database code is working. - MOD
    See if that works better. - MOD

  • JDBC/MySQL Problem

    Hello, I'm getting this error when trying to make a connection with MySQL:
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\tomcat\work\localhost_8080\_0002fdb_0002ejspdb_jsp_10.java:62: Undefined variable or class name: DriverManager
         conn = DriverManager.getConnection("jdbc:mysql:numbers", "username", "password");
         ^
    1 error, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
         at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
         at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:536)
    Here's the code I'm using:
    <%
         Class.forName("org.gjt.mm.mysql.Driver").newInstance();
         java.sql.Connection conn;
         conn = DriverManager.getConnection("jdbc:mysql:numbers", "username", "password");
    %>
    If anyone knows how to fix this, I'd appreciate any help!

    Hi,
    Three things:
    1. I presume numbers refers to the prot you are accesaing mysql - i tend to use default 3306.
    2. If there are problems recognising DriverManagaer are you importing java.sql.*; I'm sure you are.
    3. I think the sun.tools.javac.Main error relates to the tools version that you are using, although I would not guarantee this. The tools.jar in later versions of tomcat is twice the size of earlier versions and you have to ensure this is the version that your application is checking for. A quick test for this is to put the newer version(size 74k) into WEB-INF \lib directory where an application looks first for complied java files.
    best,
    kev
    ps If I'm wrong completely, let me know as I am watching this topic

  • AIFF metadata problem

    Hello,
    When editing metadata for my ALAC/AIFF files, I use the Album Artist Sort Order field (i.e., Sort Album Artist in iTunes) so that artists like 10,000 Maniacs will alphabetize to "T" (i.e., Ten Thousand Maniacs). While I have had no problem with the metadata "embedding" in my ALAC files, I have found that this data embeds transiently in AIFF files (i.e., it will be there for a few days and then disappear).
    Has anyone else experienced this issue? Does anyone know of a fix/workaround?
    Thanks,
    Tim

    Can you please state the full nature of your current issue, how you reproduce it, and examples in your site? Also, please post your site's domain.
    Thanks.

  • Oracle jdbc driver problems in netbeans 5.5

    need help again....i'm experience a problem. the problems are :
    i connect from netbeans 5.5 to oracle database express client 10g using jdbc driver ojdbc14.jar. the connection succeded (all the tables appears and i even can view the data). but when i trying to bind data to a drop down list component (with right click to the dropdown list component and then bind data), the dataprovider of that table appear in red color and there's no field appears in that. i'm so confused? i already add the ojdbc14.jar driver to the following path :
    1. i create a new class library in netbeans with consist of that driver,
    then added to my project (right click in my project then add library).
    2. then i added the ojdbc14.jar driver to my tomcats lib at "C:\Program
    Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\common\lib".
    Is there any additional settings in using oracle jdbc driver? Does anyone knows? thanks a lot for the answers...
    Message was edited by:
    darma_sadha

    Hi!
    I'm using NetBeans 6.5 and I'm having some troubles to connect.
    The steps I've made:
    - Create the connection pool in Glassfish, nothing special, just standard parameters (Based on javax.sql.DataSource and including URL, Username and Password).
    - Create the JDBC resource associated with that connection pool,let's say jdbc/test.
    Now in NetBeans I register the driver:
    - New driver -> Find the ojdbc14.jar and from the options that I can choose it shows: oracle.jdbc.OracleDriver and oracle.jdbc.driver.OracleDriver.
    If i choose without +.driver+ I got the thin drivers (the ones i want) and if i chosse the one with the other one I got the OCI drivers. So I choose the first option oracle.jdbc.OracleDriver
    - Then I go to my project and click New -> Entity Classes from Database and from Datasource I select jdbc/test and it shows the following error message:
    Unable to find the driver oracle.jdbc.driver.OracleDriver. Please register this driver in the Databases.
    I can fix it if while registering the ojdbc14.jar I select the second option (*oracle.jdbc.driver.OracleDriver*) but with this option I need to specity the connection to use OCI instead of the desired thin driver.
    I hope you'll understand and help me somehow
    Edited by: KILE on Oct 10, 2008 2:26 AM

Maybe you are looking for

  • HTML video works but not when publishing in MUSE

    I threw this together without using MUSE - Just a test video that I made in Dreamweaver.  The reason why I'm posting this in MUSE as well as DW forum is because maybe I'm not doing the "5" code correctly.  anyway --: http://designerandpublisher.com/h

  • How can I tell if someone is tracking me through my iPhone

    I have an friend who seems to always know where I am.  I think she's using the GPS in my iphone to determine where I am.  On top of that, I have seen text messages I have sent from my iPhone to others pop up on her iPad as soon as they are sent.  She

  • Please Help me in Porting Weblogic 6 EJBeans to Iplanet 6.0

    Hi All, We are planning to move from bea weblogic to Iplanet App Server, I am encountering difficulties in accessing the bean, Although I was able to deploy the bean a couple of times, I am unable to access the same from the Servlet(Client), It is un

  • Binding between SP2013 & Office WebApps 2013 failing

    Hi everyone, I'm having a bit of an issue that I'm hoping someone can help me with. I am currently running a SharePoint 2013 Server farm on Server 2012. I'm trying to get my office web apps server up and running and bind it to my SharePoint server. T

  • I have been trying to update my ipod touch iOS

    I get error message saying it has "timed out" even after it actually says the correct amount of data has been downloaded. I have already turned my firewall off, and my antivirus as well. What else is happening?? This is frustrating when the file size