public final String getMessage() {
JAXBContext jaxbContext;
StringWriter sw = new StringWriter();
try {
jaxbContext = JAXBContext.newInstance(Login.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty("jaxb.encoding", "ISO-8859-1");
jaxbMarshaller.marshal(this, sw);
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return sw.toString();
}
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的代码..我得到的输出如下.
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
Run Code Online (Sandbox Code Playgroud)
这里我想删除standalone ="yes"并希望输出为
<?xml version="1.0" encoding="ISO-8859-1"?>
Run Code Online (Sandbox Code Playgroud)
我检查了链接 JAXB - 从生成的XML中删除'standalone ="yes"' 但这里的答案正在删除完成
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Run Code Online (Sandbox Code Playgroud)
部分
我不希望那样......
请帮我..
CREATE OR REPLACE FUNCTION dummytest_insert_trigger()
RETURNS trigger AS
$BODY$
DECLARE
v_partition_name VARCHAR(32);
BEGIN
IF NEW.datetime IS NOT NULL THEN
v_partition_name := 'dummyTest';
EXECUTE format('INSERT INTO %I VALUES ($1,$2)',v_partition_name)using NEW.id,NEW.datetime;
END IF;
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION dummytest_insert_trigger()
OWNER TO postgres;
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用insert插入dummyTest值(1,'2013-01-01 00:00:00 + 05:30');
但它显示错误
ERROR: function format(unknown) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Context: PL/pgSQL …Run Code Online (Sandbox Code Playgroud)