पर्यावरण में: स्प्रिंग (3.2.3.RELEASE) + MyBatis (3.2.2) + HSQL (2.3.0)HSQLDB रिपोर्ट "उपयोगकर्ता विशेषाधिकार का अभाव है या वस्तु नहीं मिली" केवल स्मृति आधारित डेटाबेस
<resultMap id="hashMapResult" type="java.util.HashMap">
<result property="key" column="key" />
<result property="value" column="value" />
</resultMap>
<select id="getSettings" resultMap="hashMapResult">
SELECT "KEY","VALUE" from "PUBLIC"."SETTINGS";
</select>
create table "SETTINGS" (
"KEY" varchar(255) not null,
"VALUE" varchar(512) not null,
CONSTRAINT SETTINGS_KEY_UNIQUE UNIQUE("KEY")
);
यूआरएल: jdbc: hsqldb: mem: mydb; sql.syntax_mys = true; shutdown = true;
स्मृति डेटाबेस का उपयोग करते समय निम्न त्रुटियों छपी:
Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: SETTINGS
at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
at org.hsqldb.SchemaManager.getTable(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
at org.hsqldb.ParserDQL.readTableName(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source) ~[hsqldb-2.3.0.jar:2.3.0]
लेकिन जब फ़ाइल आधारित डेटाबेस JDBC का उपयोग कर: HSQLDB: फ़ाइल: mydb; sql.syntax_mys = true बंद = true बिल्कुल कोई त्रुटि नहीं
मैं वसंत के EmbeddedDatabaseFactory उपयोग कर रहा हूँ डेटाबेस init करने के लिए:
try {
EmbeddedDatabaseFactory dbFactory = new EmbeddedDatabaseFactory();
DatabaseConfig dbConfig = appConfig.getDbConfig();
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.setContinueOnError(false);
populator.setIgnoreFailedDrops(false);
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
populator.addScript(resourceLoader.getResource(dbConfig
.getSqlSchemeFile()));
populator.addScript(resourceLoader.getResource(dbConfig
.getSqlDataFile()));
dbFactory.setDatabasePopulator(populator);
dbFactory.setDatabaseName(dbConfig.getName());
dbFactory.setDatabaseConfigurer(new HSQLConfigurer(dbConfig));
return dbFactory.getDatabase();
} catch (Exception e) {
logger.error("dataSource error", e); //$NON-NLS-1$
return null;
}
किसी को भी जानता है क्यों?
को हटाने "शट डाउन = सच" मेरी समस्या हल। धन्यवाद। – SunLiWei