提交 27d7b7d3 authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved docs.

上级 d396f152
......@@ -143,7 +143,7 @@ target database, that means no joins. Prepared statements are used where possibl
To view the statements that are executed against the target table, set the trace level to 3.
</p>
<p>
There is a restriction: When inserting into a linked table, and when updating a linked table,
There is a restriction: when inserting into a linked table, and when updating a linked table,
NULL and values that are not set are both inserted as NULL.
This may not have the desired effect if the default value for this column in the target table is not NULL.
</p>
......@@ -592,10 +592,10 @@ class Test
In the database world, ACID stands for:
</p>
<ul>
<li>Atomicity: Transactions must be atomic, meaning either all tasks are performed or none.
</li><li>Consistency: All operations must comply with the defined constraints.
</li><li>Isolation: Transactions must be isolated from each other.
</li><li>Durability: Committed transaction will not be lost.
<li>Atomicity: transactions must be atomic, meaning either all tasks are performed or none.
</li><li>Consistency: all operations must comply with the defined constraints.
</li><li>Isolation: transactions must be isolated from each other.
</li><li>Durability: committed transaction will not be lost.
</li></ul>
<h3>Atomicity</h3>
......@@ -645,8 +645,8 @@ is to use the 'synchronous write' file access mode. In Java, RandomAccessFile
supports the modes "rws" and "rwd":
</p>
<ul>
<li>rwd: Every update to the file's content is written synchronously to the underlying storage device.
</li><li>rws: In addition to rwd, every update to the metadata is written synchronously.</li>
<li>rwd: every update to the file's content is written synchronously to the underlying storage device.
</li><li>rws: in addition to rwd, every update to the metadata is written synchronously.</li>
</ul>
<p>
A test (org.h2.test.poweroff.TestWrite) with one of those modes achieves around 50 thousand write operations per second.
......@@ -983,7 +983,7 @@ This is to make sure the IV is unknown to the attacker.
The reason for using a secret IV is to protect against watermark attacks.
</p><p>
Before saving a block of data (each block is 8 bytes long), the following operations are executed:
First, the IV is calculated by encrypting the block number with the IV key (using the same
first, the IV is calculated by encrypting the block number with the IV key (using the same
block cipher algorithm). This IV is combined with the plain text using XOR. The resulting data is
encrypted using the AES-128 or XTEA algorithm.
</p><p>
......@@ -1084,7 +1084,7 @@ Some values are:
</pre>
<p>
To help non-mathematicians understand what those numbers mean, here a comparison:
One's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion,
one's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion,
that means the probability is about 0.000'000'000'06.
</p>
......@@ -1125,8 +1125,7 @@ This database has the following known limitations:
</p>
<ul>
<li>The maximum file size is currently 256 GB for the data, and 256 GB for the index.
This number is excluding BLOB and CLOB data:
Every CLOB or BLOB can be up to 256 GB as well.
This number is excluding BLOB and CLOB data: every CLOB or BLOB can be up to 256 GB as well.
</li><li>The maximum file size for FAT or FAT32 file systems is 4 GB. That means when using FAT or FAT32,
the limit is 4 GB for the data. This is the limitation of the file system. The database does provide a
workaround for this problem, it is to use the file name prefix 'split:'. In that case files are split into
......
......@@ -98,10 +98,10 @@ build switchSource
<p>
The build system can generate smaller jar files as well. The following targets are currently supported:
</p>
<ul><li>jarClient: Create the h2client.jar. This only contains the JDBC client.
</li><li>jarSmall: Create the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu: Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li><li>javadocImpl: Create the Javadocs of the implementation.
<ul><li>jarClient creates the h2client.jar. This only contains the JDBC client.
</li><li>jarSmall creates the file h2small.jar. This only contains the embedded database. Debug information is disabled.
</li><li>jarJaqu creates the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation. All other jar files do not include JaQu.
</li><li>javadocImpl creates the Javadocs of the implementation.
</li></ul>
<p>
To create the h2client.jar file, go to the directory h2 and execute the following command:
......@@ -179,7 +179,7 @@ If you like to provide patches, please consider the following guidelines to simp
For SQL level tests, see <code>src/test/org/h2/test/test.in.txt</code> or <code>testSimple.in.txt</code>.
</li><li>The test cases should cover at least 90% of the changed and new code; use a code coverage tool to verify that (see above).
or use the build target 'coverage'.
</li><li>Verify that you did not break other features: Run the test cases by executing <code>build test</code>.
</li><li>Verify that you did not break other features: run the test cases by executing <code>build test</code>.
</li><li>Provide end user documentation if required (<code>src/docsrc/html/*</code>).
</li><li>Document grammar changes in <code>src/main/org/h2/res/help.csv</code>
</li><li>Provide a change log entry (<code>src/docsrc/html/changelog.html</code>).
......
......@@ -76,7 +76,7 @@ Change Log
<h2>Version 1.1.114 (2009-06-01)</h2>
<ul><li>ResultSetMetaData.getColumnClassName returned the wrong
class for CLOB and BLOB columns.
</li><li>Fulltext search: Data is no longer deleted and
</li><li>Fulltext search: data is no longer deleted and
re-inserted if the indexed columns didn't change.
</li><li>In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows.
This was caused by a bug in the b-tree code.
......@@ -105,7 +105,7 @@ Change Log
</li><li>Identifiers with a digit and then a dollar sign didn't work. Example: A1$B.
</li><li>MS SQL Server compatibility: support for linked tables with
NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR.
</li><li>Android: Workaround for a problem when using read-only databases in zip files
</li><li>Android: workaround for a problem when using read-only databases in zip files
(skip seems to be implemented incorrectly on the Android system).
</li><li>Calling execute() or prepareStatement() with null as the SQL statement
now throws an exception.
......@@ -125,7 +125,7 @@ Change Log
<h2>Version 1.1.112 (2009-05-01)</h2>
<ul><li>JdbcPreparedStatement.toString() could throw a NullPointerException.
</li><li>EclipseLink: Added H2Platform.supportsIdentity().
</li><li>EclipseLink: added H2Platform.supportsIdentity().
</li><li>Connection pool: the default login timeout is now 5 minutes.
</li><li>After truncating tables, opening large databases could become slow
because indexes were always re-built unnecessarily when opening.
......@@ -247,7 +247,7 @@ Change Log
should give slightly better query plans when using many joins.
</li><li>Improved exception message when connecting to a just started server fails.
</li><li>Connection.isValid is a bit faster.
</li><li>H2 Console: The autocomplete feature has been improved a bit. It can now better
</li><li>H2 Console: the autocomplete feature has been improved a bit. It can now better
parse conditions.
</li><li>When restarting a web application in Tomcat, an exception was thrown sometimes.
In most cases this was a NullPointerException. A workaround in H2 has been implemented.
......@@ -270,9 +270,9 @@ Change Log
<h2>Version 1.1.106 (2009-01-04)</h2>
<ul><li>Statement.setQueryTimeout did not work correctly for some statements.
</li><li>CREATE DOMAIN: Built-in data types can now only be changed if no tables exist.
</li><li>CREATE DOMAIN: built-in data types can now only be changed if no tables exist.
</li><li>Linked tables: a workaround for Oracle DATE columns has been implemented.
</li><li>DatabaseMetaData.getPrimaryKeys: The column PK_NAME now contains the
</li><li>DatabaseMetaData.getPrimaryKeys: the column PK_NAME now contains the
constraint name instead of the index name (compatibility for PostgreSQL and Derby).
</li><li>Using IN(..) inside a IN(SELECT..) did not always work.
</li><li>Views with IN(..) that used a view itself did not work.
......@@ -283,7 +283,7 @@ Change Log
</li><li>Constraints for local temporary tables now session scoped. So far they were global.
Thanks a lot to Eric Faulhaber for finding and fixing this problem!
</li><li>When using the auto-server mode, and if the lock file was modified in the future,
the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: Lock file modified in the future').
the wrong exception was thrown ('Connection is broken' instead of 'Error opening database: lock file modified in the future').
</li></ul>
<h2>Version 1.1.105 (2008-12-19)</h2>
......@@ -304,7 +304,7 @@ Change Log
</li><li>New meta data column INFORMATION_SCHEMA.TABLES.LAST_MODIFICATION to get
the table modification counter.
</li><li>Shell: line comments didn't work correctly.
</li><li>H2 Console: Columns are now listed for up to 500 tables instead of 100.
</li><li>H2 Console: columns are now listed for up to 500 tables instead of 100.
</li><li>H2 Console: Cmd+Enter executes the current statement, Alt+Space for autocomplete.
</li><li>JaQu: the maximum length of a column can now be defined using maxLength.
For an example, see Product.java (maxLength(category, 255)).
......@@ -368,7 +368,7 @@ Change Log
</li><li>The Japanese translation has been completed by Masahiro Ikemoto.
Thanks a lot!
</li><li>Improved PostgreSQL compatibility for NEXTVAL and CURRVAL.
</li><li>Less heap memory is needed when multiple databases are open at the same time: The memory reserve
</li><li>Less heap memory is needed when multiple databases are open at the same time: the memory reserve
(used to rollback after out of memory) is now global and no longer allocated for each database separately.
</li><li>New system property h2.browser to set the browser to use.
</li><li>To start the browser, java.awt.Desktop.browse is now used if available.
......@@ -553,7 +553,7 @@ Change Log
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3401
</li><li>ORDER BY on tableName.columnName didn't work correctly if the column
name was also used as an alias.
</li><li>H2 Console: The progress display when opening a database has been improved.
</li><li>H2 Console: the progress display when opening a database has been improved.
</li><li>The error message when the server doesn't start has been improved.
</li><li>Key values can now be changed in updatable result sets.
</li><li>Changes in updatable result sets are now visible even when resetting the result set.
......
......@@ -916,7 +916,7 @@ SET DEFAULT_LOCK_TIMEOUT &lt;milliseconds&gt;. The default lock timeout is persi
<p>
There are a number of files created for persistent databases. Unlike some other databases,
not every table and/or index is stored in its own file. Instead, usually only the following files are created:
A data file, an index file, a log file, and a database lock file (exists only while the database is in use).
a data file, an index file, a log file, and a database lock file (exists only while the database is in use).
In addition to that, a file is created for each large object (CLOB/BLOB) larger than a certain size,
and temporary files for large result sets.
If the database trace option is enabled, trace files are created.
......@@ -1177,7 +1177,7 @@ When the first connection is closed, the server stops. If other (remote) connect
open, one of them will then start a server (auto-reconnect is enabled automatically).
</p>
<p>
This mode has three disadvantages: All processes need to have access to the database files.
This mode has three disadvantages: all processes need to have access to the database files.
Then, if the first connection is closed (the connection that started the server), open transactions of
other connections will be rolled back.
Also, explicit client/server connections (using jdbc:h2:tcp:// or ssl://) are not supported.
......@@ -1308,7 +1308,7 @@ To create a read-only database, close the database so that the log file gets sma
Then, make the database files read-only using the operating system.
When you open the database now, it is read-only.
There are two ways an application can find out whether database is read-only:
By calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY().
by calling Connection.isReadOnly() or by executing the SQL statement CALL READONLY().
</p>
<br /><a name="database_in_zip"></a>
......@@ -1568,7 +1568,7 @@ CALL SIMPLE();
<p>
A function that returns a result set can be used like a table.
However, in this case the function is called at least twice:
First while parsing the statement to collect the column names
first while parsing the statement to collect the column names
(with parameters set to null where not known at compile time).
And then, while executing the statement to get the data (maybe multiple times if this is a join).
If the function is called just to get the column list, the URL of the connection passed to the function is
......
......@@ -82,7 +82,7 @@ A lot of features are already built in (for example Unicode, network libraries).
It is very easy to write secure code because buffer overflows can not occur.
Some features such as the reflection mechanism can be used for randomized testing.
</p><p>
Java is also future proof: A lot of companies support Java,
Java is also future proof: a lot of companies support Java,
and it is now open source.
</p><p>
This software does not rely on many Java libraries or other software, to
......
......@@ -63,7 +63,7 @@ Boolean, Integer, Long, and Double instead.
<h3>Why in Java?</h3>
<p>
Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy)
in the same application is complicated: You would need to split the application and database code.
in the same application is complicated: you would need to split the application and database code.
</p>
<h2>Current State</h2>
......
......@@ -35,11 +35,11 @@ There is a License FAQ for both the MPL and the EPL, most of that is applicable
<p>
However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2.
This happened to HSQLDB: A company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it,
This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it,
hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the
Wayback Machine of http://www.archive.org and visit old web pages of http://www.bungisoft.com .
</p><p>
About porting the source code to another language (for example C# or C++): Converted source code (even if done manually) stays under the same
About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same
copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code.
</p>
......
......@@ -26,6 +26,8 @@ Performance
Database Profiling</a><br />
<a href="#database_performance_tuning">
Performance Tuning</a><br />
<a href="#fast_import">
Fast Database Import</a><br />
<br /><a name="performance_comparison"></a>
<h2>Performance Comparison</h2>
......@@ -92,7 +94,7 @@ However H2 is not very fast in every case, certain kind of queries may still be
One situation where is H2 is slow is large result sets, because they are buffered to
disk if more than a certain number of records are returned.
The advantage of buffering is, there is no limit on the result set size.
The open/close time is almost fixed, because of the file locking protocol: The engine waits
The open/close time is almost fixed, because of the file locking protocol: the engine waits
some time after opening a database to ensure the database files are not opened by another process.
</p>
......@@ -121,7 +123,7 @@ The reason is, a backup of the whole data is made whenever the database is opene
Version 10.4.2.0 was used for the test. Derby is clearly the slowest embedded database in this test.
This seems to be a structural problem, because all operations are really slow.
It will be hard for the developers of Derby to improve the performance to a reasonable level.
A few problems have been identified: Leaving autocommit on is a problem for Derby.
A few problems have been identified: leaving autocommit on is a problem for Derby.
If it is switched off during the whole test, the results are about 20% better for Derby.
Derby supports a testing mode (system property derby.system.durability=test) where durability is
disabled. According to the documentation, this setting should be used for testing only,
......@@ -194,8 +196,8 @@ BenchB uses multiple connections; the other tests use one connection.
<h4>Real-World Tests</h4>
<p>
Good benchmarks emulate real-world use cases. This benchmark includes 3 test cases:
A simple test case with one table and many small updates / deletes.
Good benchmarks emulate real-world use cases. This benchmark includes 4 test cases:
BenchSimple uses one table and many small updates / deletes.
BenchA is similar to the TPC-A test, but single connection / single threaded (see also: www.tpc.org).
BenchB is similar to the TPC-B test, using multiple connections (one thread per connection).
BenchC is similar to the TPC-C test, but single connection / single threaded.
......@@ -471,4 +473,20 @@ By default the cache size of H2 is quite small. Consider using a larger cache si
the second level soft reference cache. See also <a href="features.html#cache_settings">Cache Settings</a>.
</p>
<br /><a name="fast_import"></a>
<h2>Fast Database Import</h2>
<p>
To speed up large imports, consider using the following options temporarily:
</p>
<ul><li>SET CACHE_SIZE (a large cache is faster)
</li><li>SET LOCK_MODE 0 (disable locking)
</li><li>SET LOG 0 (disable the transaction log)
</li><li>SET UNDO_LOG 0 (disable the session undo log)
</li></ul>
<p>
These options can be set in the database URL:
<code>jdbc:h2:~/test;CACHE_SIZE=65536;LOCK_MODE=0;LOG=0;UNDO_LOG=0</code>.
Most of those options are not recommended for regular use, that means you need to reset them after use.
</p>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
......@@ -56,7 +56,7 @@ Install the software using the Windows Installer (if you did not yet do that).
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br />
<img class="screenshot" src="images/quickstart-1.png" alt="screenshot: start H2 Console" /><br />
A new console window appears:<br />
<img class="screenshot" src="images/quickstart-2.png" alt="screenshot: H2 Running" /><br />
<img class="screenshot" src="images/quickstart-2.png" alt="screenshot: H2 running" /><br />
Also, a new browser page should open with the URL <a href="http://localhost:8082">http://localhost:8082</a>.
You may get a security warning from the firewall. If you don't want other computers in the network to access the database
on your machine, you can let the firewall block these connections. Only local connections are required at this time.
......@@ -65,7 +65,7 @@ on your machine, you can let the firewall block these connections. Only local co
<h4>Login</h4>
<p>
Select [Generic H2] and click [Connect]:<br />
<img class="screenshot" src="images/quickstart-3.png" alt="screenshot: Login screen" /><br />
<img class="screenshot" src="images/quickstart-3.png" alt="screenshot: login" /><br />
You are now logged in.
</p>
......
......@@ -185,7 +185,7 @@ by clicking on the message.
<h3>Adding Database Drivers</h3>
<p>
Additional database drivers can be registered by adding the Jar file location of the driver to the environment
variables H2DRIVERS or CLASSPATH. Example (Windows): To add the database driver library
variables H2DRIVERS or CLASSPATH. Example (Windows): to add the database driver library
C:\Programs\hsqldb\lib\hsqldb.jar, set the environment variable H2DRIVERS to
C:\Programs\hsqldb\lib\hsqldb.jar.
</p><p>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,7 +34,7 @@ adminTranslateStart=Translate
helpAction=Action
helpAddAnotherRow=Add another row
helpAddDrivers=Adding Database Drivers
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: to add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Add a new row
helpCommandHistory=Shows the Command History
helpCreateTable=Create a new table
......
......@@ -243,7 +243,7 @@ public class FullText {
/**
* Searches from the full text index for this database.
* The returned result set has the following column:
* <ul><li>QUERY (varchar): The query to use to get the data.
* <ul><li>QUERY (varchar): the query to use to get the data.
* The query does not include 'SELECT * FROM '. Example:
* PUBLIC.TEST WHERE ID = 1
* </li></ul>
......@@ -263,11 +263,11 @@ public class FullText {
* the primary key data as an array. The returned result set has the
* following columns:
* <ul>
* <li>SCHEMA (varchar): The schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): The table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): Comma separated list of quoted column
* <li>SCHEMA (varchar): the schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): the table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): comma separated list of quoted column
* names. The column names are quoted if necessary. Example: (ID) </li>
* <li>KEYS (array of values): Comma separated list of values. Example: (1)
* <li>KEYS (array of values): comma separated list of values. Example: (1)
* </li>
* </ul>
*
......
......@@ -166,7 +166,7 @@ public class FullTextLucene extends FullText {
/**
* Searches from the full text index for this database.
* The returned result set has the following column:
* <ul><li>QUERY (varchar): The query to use to get the data.
* <ul><li>QUERY (varchar): the query to use to get the data.
* The query does not include 'SELECT * FROM '. Example:
* PUBLIC.TEST WHERE ID = 1
* </li></ul>
......@@ -188,11 +188,11 @@ public class FullTextLucene extends FullText {
* the primary key data as an array. The returned result set has the
* following columns:
* <ul>
* <li>SCHEMA (varchar): The schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): The table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): Comma separated list of quoted column
* <li>SCHEMA (varchar): the schema name. Example: PUBLIC </li>
* <li>TABLE (varchar): the table name. Example: TEST </li>
* <li>COLUMNS (array of varchar): comma separated list of quoted column
* names. The column names are quoted if necessary. Example: (ID) </li>
* <li>KEYS (array of values): Comma separated list of values. Example: (1)
* <li>KEYS (array of values): comma separated list of values. Example: (1)
* </li>
* </ul>
*
......
......@@ -54,7 +54,7 @@ import java.sql.SQLClientInfoException;
* Represents a connection (session) to a database.
* </p>
* <p>
* Thread safety: The connection is thread-safe, because access
* Thread safety: the connection is thread-safe, because access
* is synchronized. However, for compatibility with other databases, a
* connection should only be used in one thread at any time.
* </p>
......@@ -591,11 +591,11 @@ public class JdbcConnection extends TraceObject implements Connection {
* one, except if the level is not supported. Internally, this method calls
* SET LOCK_MODE. The following isolation levels are supported:
* <ul>
* <li> Connection.TRANSACTION_READ_UNCOMMITTED = SET LOCK_MODE 0: No
* <li> Connection.TRANSACTION_READ_UNCOMMITTED = SET LOCK_MODE 0: no
* locking (should only be used for testing). </li>
* <li>Connection.TRANSACTION_SERIALIZABLE = SET LOCK_MODE 1: Table level
* <li>Connection.TRANSACTION_SERIALIZABLE = SET LOCK_MODE 1: table level
* locking. </li>
* <li>Connection.TRANSACTION_READ_COMMITTED = SET LOCK_MODE 3: Table
* <li>Connection.TRANSACTION_READ_COMMITTED = SET LOCK_MODE 3: table
* level locking, but read locks are released immediately (default). </li>
* </ul>
* This setting is not persistent. Please note that using
......
......@@ -230,7 +230,7 @@ public class JdbcConnectionPool implements DataSource {
/**
* This method usually puts the connection back into the pool. There are
* some exception: If the pool is disposed, the connection is disposed as
* some exceptions: if the pool is disposed, the connection is disposed as
* well. If the pool is full, the connection is closed.
*
* @param pc the pooled connection
......
......@@ -543,7 +543,7 @@ DROP ALL OBJECTS [DELETE FILES]
Drops all existing views, tables, sequences, schemas, function aliases, roles,
user-defined aggregate functions, domains, and users (except the current user).
If DELETE FILES is specified, the database files will be removed when the last
user disconnects from the database. Warning: This command can not be rolled
user disconnects from the database. Warning: this command can not be rolled
back. Admin rights are required to execute this command.
","
DROP ALL OBJECTS
......@@ -975,7 +975,7 @@ data and index changes are enabled.
Transaction logging can be disabled to improve the performance when durability
is not important, for example while running tests or when loading the database.
Warning: It may not be possible to recover the database if logging is disabled
Warning: it may not be possible to recover the database if logging is disabled
and the application terminates abnormally. If logging of index changes is
enabled, opening a database that was crashed becomes faster because the indexes
don't need to be rebuilt.
......@@ -2846,7 +2846,8 @@ CASEWHEN(ID=1, 'A', 'B')
"Functions (System)","CAST","
CAST(value AS dataType): value
","
Converts a value to another data type.
Converts a value to another data type. When converting a text to a number, the default Java conversion
rules are used (prefixes 0x or # for hexadecimal numbers, prefix 0 for octal numbers).
","
CAST(NAME AS INT)
"
......@@ -2884,12 +2885,16 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString
[, nullString]]]]]]): resultSet
","
Returns the result set of reading the CSV (comma separated values) file. For
each parameter, NULL means the default value should be used. If the column names
are specified (a list of column names separated with the fieldSeparator), those
are used they are read from the file, otherwise (or if they are set to NULL) the
first line of the file is interpreted as the column names. The default charset
is the default value for this system, and the default field separator is a
comma. Missing unquoted values as well as data that matches nullString is
each parameter, NULL means the default value should be used.
If the column names are specified (a list of column names separated with the
fieldSeparator), those are used they are read from the file, otherwise
(or if they are set to NULL) the first line of the file is interpreted as the column names.
Column names are case sensitive, that means you need to use quoted identifiers
unless the column names are capitalized (see below).
The default charset is the default value for this system, and the default field separator
is a comma. Missing unquoted values as well as data that matches nullString is
parsed as NULL. All columns of type VARCHAR.
This function can be used like a table: SELECT * FROM CSVREAD(...).
......@@ -2903,6 +2908,7 @@ CALL CSVREAD('test.csv');
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
-- Read a semicolon-separated file
SELECT * FROM CSVREAD('data/test.csv', NULL, NULL, ';');
SELECT ""Last Name"" FROM CSVREAD('address.csv');
"
"Functions (System)","CSVWRITE","
......
......@@ -34,7 +34,7 @@ adminTranslateStart=Translate
helpAction=Action
helpAddAnotherRow=Add another row
helpAddDrivers=Adding Database Drivers
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: To add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddDriversText=Additional database drivers can be registered by adding the Jar file location of the driver to the the environment variables H2DRIVERS or CLASSPATH. Example (Windows)\: to add the database driver library C\:\\Programs\\hsqldb\\lib\\hsqldb.jar, set the environment variable H2DRIVERS to C\:\\Programs\\hsqldb\\lib\\hsqldb.jar.
helpAddRow=Add a new row
helpCommandHistory=Shows the Command History
helpCreateTable=Create a new table
......
......@@ -99,7 +99,7 @@ Initial Developer: H2 Group
In embedded mode, the database runs in the same process as the application.
Only one process may access a database at any time.
Databases are automatically created if they don't exist.
<b>Warning</b>: If no path is used (for example jdbc:h2:test),
<b>Warning</b>: if no path is used (for example jdbc:h2:test),
then the database is stored in the current working directory
(the directory where the application was started).
URLs of the form jdbc:h2:data/test are relative to
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论