H2 Database Import CSV file realization principle Simple analysis _mssql

Source: Internet
Author: User
Tags import database
1. Start the H2 database does not open the browser window (default is open)
2. Database creation SQL adds support for bigdecimal types, H2 databases do not support BigDecimal types by default:

SQL code
Copy Code code as follows:

CREATE TABLE test (ID int (one), Charge BigDecimal (12))

SQL code
Copy Code code as follows:

CREATE TABLE test (ID int (one), Charge BigDecimal (12))


3. Import database scripts by passing parameters
Copy Code code as follows:

New Console (). Runtool ();
New RunScript (). RunCustomTool ("Jdbc:h2:~/test", "sa", "" "," C:/schema.sql ");

H2 Database Import CSV file
Copy Code code as follows:

Insert INTO prescription (SELECT * from Csvread (' c:/jv/demo/prescription2012-05-10 22-26-37.csv '));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.