Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. Exception in thread "main" scriptella.execution.EtlExecutorException: Location: /etl/query[1]/script[1]
  2. JDBC provider exception: Unable to get parameter 4
  3. Error codes: [S1009, 0]
  4. Driver exception: java.sql.SQLException: Cannot convert value '2006' from column 4 to TIMESTAMP.
  5. at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:190)
  6. at com.zensar.scrptellaTest.App.main(App.java:21)
  7. Caused by: scriptella.core.ExceptionInterceptor$ExecutionException: /etl/query[1]/script[1] failed: Unable to get parameter 4
  8. at scriptella.core.ExceptionInterceptor.execute(ExceptionInterceptor.java:44)
  9. at scriptella.core.QueryExecutor$QueryCtxDecorator.processRow(QueryExecutor.java:114)
  10. at scriptella.jdbc.StatementWrapper.query(StatementWrapper.java:92)
  11. at scriptella.jdbc.SqlExecutor.statementParsed(SqlExecutor.java:128)
  12. at scriptella.jdbc.SqlParserBase.handleStatement(SqlParserBase.java:129)
  13. at scriptella.jdbc.SqlParserBase.parse(SqlParserBase.java:72)
  14. at scriptella.jdbc.SqlExecutor.execute(SqlExecutor.java:85)
  15. at scriptella.jdbc.JdbcConnection.executeQuery(JdbcConnection.java:222)
  16. at scriptella.core.QueryExecutor.execute(QueryExecutor.java:71)
  17. at scriptella.core.ContentExecutor.execute(ContentExecutor.java:73)
  18. at scriptella.core.ElementInterceptor.executeNext(ElementInterceptor.java:56)
  19. at scriptella.core.StatisticInterceptor.execute(StatisticInterceptor.java:41)
  20. at scriptella.core.ElementInterceptor.executeNext(ElementInterceptor.java:56)
  21. at scriptella.core.ConnectionInterceptor.execute(ConnectionInterceptor.java:36)
  22. at scriptella.core.ElementInterceptor.executeNext(ElementInterceptor.java:56)
  23. at scriptella.core.ExceptionInterceptor.execute(ExceptionInterceptor.java:39)
  24. at scriptella.core.Session.execute(Session.java:103)
  25. at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:227)
  26. at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:183)
  27. ... 1 more
  28.  
  29. '1', 'ACADEMY DINOSAUR', 'A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies', 2006, '1', NULL, '6', '0.99', '86', '20.99', 'PG', 'Deleted Scenes,Behind the Scenes', '2006-02-15 05:03:42'
  30.  
  31. CREATE TABLE `film` (
  32. `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  33. `title` varchar(255) NOT NULL,
  34. `description` text,
  35. `release_year` year(4) DEFAULT NULL,
  36. `language_id` tinyint(3) unsigned NOT NULL,
  37. `original_language_id` tinyint(3) unsigned DEFAULT NULL,
  38. `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
  39. `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
  40. `length` smallint(5) unsigned DEFAULT NULL,
  41. `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
  42. `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G',
  43. `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL,
  44. `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  45. PRIMARY KEY (`film_id`),
  46. KEY `idx_title` (`title`),
  47. KEY `idx_fk_language_id` (`language_id`),
  48. KEY `idx_fk_original_language_id` (`original_language_id`),
  49. CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE,
  50. CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE
  51. ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8;
  52.  
  53. CREATE TABLE `film` (
  54. `film_id` smallint(5) unsigned NOT NULL,
  55. `title` varchar(255) NOT NULL,
  56. `description` text,
  57. `release_year` year(4) DEFAULT NULL,
  58. `language_id` tinyint(3) unsigned NOT NULL,
  59. `original_language_id` tinyint(3) unsigned DEFAULT NULL,
  60. `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
  61. `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
  62. `length` smallint(5) unsigned DEFAULT NULL,
  63. `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
  64. `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G',
  65. `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL,
  66. `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  68.  
  69. <!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
  70. <etl>
  71. <description>Scriptella ETL File Template.</description>
  72. <!-- Connection declarations -->
  73. <connection id="source" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/sakila" user="root" password="12345" />
  74. <connection id="target" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/trg" user="root" password="12345" />
  75.  
  76. <!-- Uncomment and modify to run a query-based transformation -->
  77. <query connection-id="source">
  78. SELECT * FROM film;
  79. <script connection-id="target">
  80. INSERT INTO film VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13);
  81. </script>
  82. </query>
  83.  
  84. </etl>
  85.  
  86. public static void main(String[] args) throws EtlExecutorException {
  87. ProgressIndicatorBase indicatorBase = new ProgressIndicatorBase() {
  88.  
  89. @Override
  90. protected void show(String label, double progress) {
  91. System.out.println(label + "--> " + progress);
  92.  
  93. }
  94. };
  95.  
  96. EtlExecutor.newExecutor(new File("etl.xml")).execute(indicatorBase);
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement