scriptella.jdbc

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » scriptella » scriptella.jdbc 
scriptella.jdbc
Scriptella JDBC Bridge.

As specified in Service Provider API all JDBC drivers are registered via this bridge. This procedure is transparent to end user, he only have to specify jdbc driver class name or an alias.

General information

Driver class:JDBC driver class name
URL:JDBC driver URL, e.g. jdbc:mydb:...
Runtime dependencies:Set of libraries required by the JDBC driver.

JDBC Bridge Properties

JDBC bridge makes the following configuration properties available in configuration element:

Name Description Required
statement.cache Size of prepared statements cache or 0 to disable statement caching. No, the default value is 100.
statement.separator SQL statements separator string. Similar to Ant delimiter property. No, the default value is ; (semicolon).
statement.separator.singleline True if the delimiter should only be recognized on a line by itself. Leading and trailing whitespaces are ignored when searching for a separator in statement.separator.singleline=true mode. Similar to Ant delimitertype property. No, the default value is false.
keepformat True if the original SQL formatting should be preserved.

This property is similar to Ant keepformat property except that Oracle-style hints (?*+ hint */) are always preserved in Scriptella.

No, the default value is false, i.e. extra whitespaces and comments removed.
transaction.isolation Transaction isolation level name or an integer value according to java.sql.Connection javadoc. The valid level names are: READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ and SERIALIZABLE. No, the default value is driver specific.
autocommit True if connection is in auto-commit mode. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions.See also autocommit.size.

Note: In general avoid setting autocommit to true, because in this case an ETL process cannot be rolled back correctly. Use this parameter only for performance critical operations (bulk inserts etc.).

No, the default value is false.
autocommit.size If positive, specifies the number of statements to execute before producing implicit commit, i.e. controls how much data is committed in its batches.

Notes:

  • In general avoid using autocommit.size, because in this case an ETL process cannot be rolled back correctly. Use this parameter only for performance critical operations (bulk inserts etc.).
  • If the autocommit is true, then setting autocommit.size has no effect

No, the default value is false.

Properties Substitution

The bridge supports standard ${} variables expansion and allows to set prepared statement parameters via ?{} syntax.

Example:


var=_name
id=11
--------------------------------------
select * FROM table${var} where id=?id
-- is transformed to a JDBC prepared statement---
select * FROM table_name where id=?
-- where parameter id=11

Notes:

  • $ prefixed expressions are substituted in all parts except comments.
  • ? prefixed expressions are not substituted inside quotes and comments.

  • Example:
    --only ${prop} and ?surname are handled
         SELECT * FROM "Table" WHERE NAME="?John${prop}" and SURNAME=?surname;
        

Examples

    <connection id="in" driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:file:tmp" user="sa" classpath="hsqldb.jar">
        #Disable cache - just for example
        statement.cache=0
        #Set SQL statements separator
        statement.separator=;
    </connection>

    <connection id="out" driver="h2" url="jdbc:h2:file:out" user="sa"/>
    <query connection-id="in">
        SELECT * from Bug
        <script connection-id="out">
            INSERT INTO Bug VALUES (?ID, ?priority, ?summary, ?status);
        </script>
    </query>
Java Source File NameTypeComment
AutocommitITest.javaClass Integration tests for scriptella.jdbc.JdbcConnection.autocommit and scriptella.jdbc.JdbcConnection.autocommitSize parameters.
CachedSqlTokenizer.javaClass This tokenizer uses target to tokenize statements and remembers parsed statements and injections, so it can be reset and iterated several times.
CachedSqlTokenizerTest.javaClass Tests for CachedSqlTokenizer .
GenericDriver.javaClass Generic adapter for JDBC drivers.
JdbcConnection.javaClass Represents a JDBC connection.
JdbcConnectionITest.javaClass Integration test for JDBC connection.
JdbcException.javaClass Unchecked wrapper for SQL exceptions or other SQL related errors.
JdbcTypesConverter.javaClass Represents a converter for prepared statement parameters and result set columns.

This class defines a strategy for handling specific parameters like URL and by default provides a generic behaviour for any objects.

Configuration by exception is the general philosophy of this class, i.e. most of the conversions must be performed by a provided resultset/preparedstatement and custom conversions are applied only in rare cases.

JdbcUtils.javaClass Utility class JDBC related operations.
Lobs.javaClass Factory for LOBs.
LobsTest.javaClass Tests for Lobs .
NestedElementsPerfTest.javaClass Tests for nested elements handling.
ParametersParser.javaClass Parses parameter expressions in SQL statements.
ParametersParserTest.javaClass Tests for ParametersParser .
QueryHelper.javaClass Query abstraction to for tests.
ResultSetAdapter.javaClass Represents SQL query result set as ParametersCallback .
SqlExecutor.javaClass SQL statements executor.
SqlParserBase.javaClass Customizable SQL parser.
SQLParserBaseTest.javaClass Tests scriptella.jdbc.SqlParserBase .
SqlReaderTokenizer.javaClass Reader based SQL tokenizer.
SqlTokenizer.javaInterface This interface provides a contract to iterate SQL statements.
SqlTokenizerITest.javaClass Integration test for SqlReaderTokenizer .
SqlTokenizerPerfTest.javaClass Performance tests for SqlReaderTokenizer .
SqlTokenizerTest.javaClass Tests for SqlReaderTokenizer .
StatementCache.javaClass Statements cache for JdbcConnection .
StatementCachePerfTest.javaClass Performance tests for scriptella.jdbc.StatementCache .
StatementCacheTest.javaClass Tests for StatementCache .
StatementWrapper.javaClass Abstraction for java.sql.Statement and java.sql.PreparedStatement .
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.