{"record":{"id":"6f44bc0059f0f09f","repo":"pentaho/pentaho-kettle","slug":"error-getting-row-information-from-database","errorCode":null,"errorMessage":"Error getting row information from database: ","messagePattern":"Error getting row information from database: ","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/Database.java","lineNumber":2892,"sourceCode":"    throws KettleDatabaseException {\n    try {\n      log.snap( Metrics.METRIC_DATABASE_GET_ROW_META_START, databaseMeta.getName() );\n\n      if ( rm == null ) {\n        throw new KettleDatabaseException( \"No result set metadata available to retrieve row metadata!\" );\n      }\n\n      RowMetaInterface rowMeta = new RowMeta();\n\n      try {\n        int nrcols = rm.getColumnCount();\n        for ( int i = 1; i <= nrcols; i++ ) {\n          ValueMetaInterface valueMeta = getValueFromSQLType( rm, i, ignoreLength, lazyConversion );\n          rowMeta.addValueMeta( valueMeta );\n        }\n        return rowMeta;\n      } catch ( SQLException ex ) {\n        throw new KettleDatabaseException( \"Error getting row information from database: \", ex );\n      }\n    } finally {\n      log.snap( Metrics.METRIC_DATABASE_GET_ROW_META_STOP, databaseMeta.getName() );\n    }\n  }\n\n  private ValueMetaInterface getValueFromSQLType( ResultSetMetaData rm, int i, boolean ignoreLength,\n                                                  boolean lazyConversion )\n    throws KettleDatabaseException, SQLException {\n    // TODO If we do lazy conversion, we need to find out about the encoding\n    //\n\n    // Extract the name from the result set meta data...\n    //\n    String name;\n    if ( databaseMeta.isMySQLVariant() ) {\n      name = databaseMeta.getDatabaseInterface().getLegacyColumnName( getDatabaseMetaData(), rm, i );\n    } else {","sourceCodeStart":2874,"sourceCodeEnd":2910,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/Database.java#L2874-L2910","documentation":"KettleDatabaseException wrapper for a SQLException raised while iterating result set metadata columns to build RowMetaInterface. After successfully obtaining metadata, each column's SQL type is converted via getValueFromSQLType; if any column access fails (SQLException), this error is thrown with the original as cause.","triggerScenarios":"During getRowInfo(), rm.getColumnCount() succeeds but a per-column call (getColumnName, getColumnType, getPrecision, etc.) throws SQLException — typically for column index i — while building the row layout.","commonSituations":"Broken/partial JDBC driver metadata implementations; metadata invalidated by concurrent statement close; exotic column types the driver mis-describes; connection dropped mid-metadata-read.","solutions":["Inspect the chained SQLException cause for the real driver error","Update the JDBC driver to a version with correct metadata support","Verify the connection is still open while metadata is read","Log the SQL query and check for unsupported column types (e.g. vendor-specific types)"],"exampleFix":"// before\nRowMetaInterface meta = db.getRowInfo(rsmd, false, false);\n// after\ntry {\n  RowMetaInterface meta = db.getRowInfo(rsmd, false, false);\n} catch (KettleDatabaseException e) {\n  throw new KettleDatabaseException(\"Row layout extraction failed for query\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"try { rsmd.getColumnCount(); } catch (SQLException e) {\n  throw new IllegalStateException(\"Metadata unreadable: \" + e.getMessage());\n}","typeGuard":"null","tryCatchPattern":"try {\n  meta = db.getRowInfo(rsmd, false, false);\n} catch (KettleDatabaseException e) {\n  logError(\"Column metadata read failed: \", e.getCause());\n  throw e;\n}","preventionTips":["Keep the connection open until metadata conversion completes","Use up-to-date vendor JDBC drivers","Avoid selecting vendor-specific column types in metadata-sensitive queries","Test queries against the exact target database version"],"tags":["jdbc","metadata","sqlexception"],"backgroundTag":"database-query-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}