我在H2 database
创建了一个表格,其中Photo
列的数据类型为varbinary
CREATE TABLE Employees
(
Id int,
Name varchar(50) not null,
Photo varbinary(max) not null
)
但我无法使用LOAD_FILE
INSERT INTO Employees (Id, Name, Photo)
values (10, 'John', LOAD_FILE('C:\a.jpg'));
获取以下错误:
Function "LOAD_FILE" not found; SQL statement:
INSERT INTO Employees (Id, Name, Photo)
values (10, 'John', LOAD_FILE('C:\a.jpg')) [90022-187] 90022/90022 (Help)
org.h2.jdbc.JdbcSQLException: Function "LOAD_FILE" not found; SQL statement:
INSERT INTO Employees (Id, Name, Photo)
values (10, 'John', LOAD_FILE('C:\a.jpg')) [90022-187]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.command.Parser.readJavaFunction(Parser.java:2351)
at org.h2.command.Parser.readFunction(Parser.java:2403)
at org.h2.command.Parser.readTerm(Parser.java:2737)
at org.h2.command.Parser.readFactor(Parser.java:2259)
at org.h2.command.Parser.readSum(Parser.java:2246)
at org.h2.command.Parser.readConcat(Parser.java:2216)
at org.h2.command.Parser.readCondition(Parser.java:2066)
at org.h2.command.Parser.readAnd(Parser.java:2038)
at org.h2.command.Parser.readExpression(Parser.java:2030)
at org.h2.command.Parser.parseInsert(Parser.java:1062)
at org.h2.command.Parser.parsePrepared(Parser.java:401)
at org.h2.command.Parser.parse(Parser.java:305)
at org.h2.command.Parser.parse(Parser.java:277)
at org.h2.command.Parser.prepareCommand(Parser.java:242)
at org.h2.engine.Session.prepareLocal(Session.java:461)
at org.h2.engine.Session.prepareCommand(Session.java:403)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1189)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:170)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
at org.h2.server.web.WebApp.getResult(WebApp.java:1390)
at org.h2.server.web.WebApp.query(WebApp.java:1063)
at org.h2.server.web.WebApp$1.next(WebApp.java:1025)
at org.h2.server.web.WebApp$1.next(WebApp.java:1012)
at org.h2.server.web.WebThread.process(WebThread.java:168)
at org.h2.server.web.WebThread.run(WebThread.java:93)
at java.lang.Thread.run(Unknown Source)