h2导入数据脚本csv

1.启动H2数据库不打开浏览器窗口(默认是打开的)
2.数据库创建SQL增加了支持BigDecimal类型,h2数据库默认是不支持bigdecimal类型的:

Sql代码
  1. create table test(id int(11),charge BigDecimal(12))  
create table test(id int(11),charge BigDecimal(12))


3.通过传参数方式导入数据库脚本

new Console().runTool();   

new RunScript().runCustomTool("jdbc:h2:~/test""sa","""c:/schema.sql"); 

 

 

H2 数据库导入CSV文件

insert into prescription ( select * from csvread('c:/JV/Demo/prescription2012-05-10 22-26-37.csv')) ;

 

猜你喜欢

转载自guoyiqi.iteye.com/blog/1734245
h2