提交 74108a40 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 7c091a02
......@@ -1006,13 +1006,14 @@ public class MetaTable extends Table {
}
String columnList = null;
if(columns != null) {
columnList = "";
StringBuffer buff = new StringBuffer();
for(int j=0; j<columns.length; j++) {
if(j>0) {
columnList += ",";
buff.append(',');
}
columnList += columns[j].getName();
buff.append(columns[j].getName());
}
columnList = buff.toString();
}
add(rows, new String[] {
catalog, // CONSTRAINT_CATALOG
......
......@@ -37,12 +37,12 @@ public class Backup {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-url jdbc:h2:... (database URL)
* <li>-user username
* <li>-password password
* <li>-script filename (default file name is backup.sql)
* <li>-options to specify a list of options (only for H2)
* </ul>
* </li><li>-url jdbc:h2:... (database URL)
* </li><li>-user username
* </li><li>-password password
* </li><li>-script filename (default file name is backup.sql)
* </li><li>-options to specify a list of options (only for H2)
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -39,13 +39,13 @@ public class ChangePassword extends FileBase {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-cipher type (AES or XTEA)
* <li>-decrypt password (null if the database is not encrypted)
* <li>-encrypt password (null if the database should not be encrypted)
* <li>-quiet does not print progress information
* </ul>
* </li><li>-dir directory (the default is the current directory)
* </li><li>-db databaseName (all databases if no name is specified)
* </li><li>-cipher type (AES or XTEA)
* </li><li>-decrypt password (null if the database is not encrypted)
* </li><li>-encrypt password (null if the database should not be encrypted)
* </li><li>-quiet does not print progress information
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -30,10 +30,10 @@ public class ConvertTraceFile {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-traceFile filename (the default is test.trace.db)
* <li>-script filename (the default is test.sql)
* <li>-javaClass className (the default is Test)
* </ul>
* </li><li>-traceFile filename (the default is test.trace.db)
* </li><li>-script filename (the default is test.sql)
* </li><li>-javaClass className (the default is Test)
* </li></ul>
*
* @param args the command line arguments
* @throws Exception
......
......@@ -31,9 +31,9 @@ public class CreateCluster {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-urlSource jdbc:h2:... (the database URL of the source database)
* <li>-urlTarget jdbc:h2:... (the database URL of the target database)
* </ul>
* </li><li>-urlSource jdbc:h2:... (the database URL of the source database)
* </li><li>-urlTarget jdbc:h2:... (the database URL of the target database)
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -107,7 +107,7 @@ public class Csv implements SimpleRowSource {
columnNames = colNames;
initRead();
SimpleResultSet result = new SimpleResultSet(this);
normalizeColumnNames();
makeColumnNamesUnique();
for(int i=0; i<columnNames.length; i++) {
result.addColumn(columnNames[i], Types.VARCHAR, 255, 0);
}
......@@ -135,7 +135,7 @@ public class Csv implements SimpleRowSource {
this.reader = reader;
initRead();
SimpleResultSet result = new SimpleResultSet(this);
normalizeColumnNames();
makeColumnNamesUnique();
for(int i=0; i<columnNames.length; i++) {
result.addColumn(columnNames[i], Types.VARCHAR, 255, 0);
}
......@@ -145,7 +145,7 @@ public class Csv implements SimpleRowSource {
}
}
private void normalizeColumnNames() {
private void makeColumnNamesUnique() {
for(int i=0; i<columnNames.length; i++) {
String x = columnNames[i];
if(x == null || x.length()==0) {
......
......@@ -29,10 +29,10 @@ public class DeleteDbFiles extends FileBase {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-quiet does not print progress information
* </ul>
* </li><li>-dir directory (the default is the current directory)
* </li><li>-db databaseName (all databases if no name is specified)
* </li><li>-quiet does not print progress information
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -74,10 +74,10 @@ public class Recover implements DataHandler {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-log {true|false} (log additional messages)
* </ul>
* </li><li>-dir directory (the default is the current directory)
* </li><li>-db databaseName (all databases if no name is specified)
* </li><li>-log {true|false} (log additional messages)
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -44,13 +44,13 @@ public class RunScript {
* following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-url jdbc:h2:... (database URL)
* <li>-user username
* <li>-password password
* <li>-script filename (default file name is backup.sql)
* <li>-driver driver the JDBC driver class name (not required for H2)
* <li>-options to specify a list of options (only for H2 and only when using the embedded mode)
* </ul>
* </li><li>-url jdbc:h2:... (database URL)
* </li><li>-user username
* </li><li>-password password
* </li><li>-script filename (default file name is backup.sql)
* </li><li>-driver driver the JDBC driver class name (not required for H2)
* </li><li>-options to specify a list of options (only for H2 and only when using the embedded mode)
* </li></ul>
* To include local files when using remote databases, use the special syntax:
* <pre>
* &#64;INCLUDE fileName
......
......@@ -72,34 +72,34 @@ public class Server implements Runnable {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-web (start the Web Server)
* <li>-tcp (start the TCP Server)
* <li>-tcpShutdown {url} (shutdown the running TCP Server, URL example: tcp://localhost:9094)
* <li>-odbc (start the ODBC Server)
* <li>-browser (start a browser and open a page to connect to the Web Server)
* <li>-log [true|false] (enable or disable logging)
* <li>-baseDir {directory} (sets the base directory for database files)
* <li>-ifExists [true|false] (only existing databases may be opened)
* <li>-ftp (start the FTP Server)
* </ul>
* </li><li>-web (start the Web Server)
* </li><li>-tcp (start the TCP Server)
* </li><li>-tcpShutdown {url} (shutdown the running TCP Server, URL example: tcp://localhost:9094)
* </li><li>-odbc (start the ODBC Server)
* </li><li>-browser (start a browser and open a page to connect to the Web Server)
* </li><li>-log [true|false] (enable or disable logging)
* </li><li>-baseDir {directory} (sets the base directory for database files)
* </li><li>-ifExists [true|false] (only existing databases may be opened)
* </li><li>-ftp (start the FTP Server)
* </li></ul>
* For each Server, there are additional options available:
* <ul>
* <li>-webPort {port} (the port of Web Server, default: 8082)
* <li>-webSSL [true|false] (if SSL should be used)
* <li>-webAllowOthers [true|false] (enable/disable remote connections)
* <li>-tcpPort {port} (the port of TCP Server, default: 9092)
* <li>-tcpSSL [true|false] (if SSL should be used)
* <li>-tcpAllowOthers [true|false] (enable/disable remote connections)
* <li>-tcpPassword {password} (the password for shutting down a TCP Server)
* <li>-tcpShutdownForce [true|false] (don't wait for other connections to close)
* <li>-odbcPort {port} (the port of ODBC Server, default: 9083)
* <li>-odbcAllowOthers [true|false] (enable/disable remote connections)
* <li>-ftpPort {port}
* <li>-ftpDir {directory}
* <li>-ftpRead {readUserName}
* <li>-ftpWrite {writeUserName}
* <li>-ftpWritePassword {password}
* </ul>
* </li><li>-webSSL [true|false] (if SSL should be used)
* </li><li>-webAllowOthers [true|false] (enable/disable remote connections)
* </li><li>-tcpPort {port} (the port of TCP Server, default: 9092)
* </li><li>-tcpSSL [true|false] (if SSL should be used)
* </li><li>-tcpAllowOthers [true|false] (enable/disable remote connections)
* </li><li>-tcpPassword {password} (the password for shutting down a TCP Server)
* </li><li>-tcpShutdownForce [true|false] (don't wait for other connections to close)
* </li><li>-odbcPort {port} (the port of ODBC Server, default: 9083)
* </li><li>-odbcAllowOthers [true|false] (enable/disable remote connections)
* </li><li>-ftpPort {port}
* </li><li>-ftpDir {directory}
* </li><li>-ftpRead {readUserName}
* </li><li>-ftpWrite {writeUserName}
* </li><li>-ftpWritePassword {password}
* </li></ul>
*
* @param args the command line arguments
* @throws SQLException
......
......@@ -45,9 +45,12 @@ public class Newsfeed {
s = StringUtils.replaceAll(s, "<ul>", "");
s = StringUtils.replaceAll(s, "</ul>", "");
s = StringUtils.replaceAll(s, "<li>", "- ");
s = StringUtils.replaceAll(s, "</li>", "");
s = StringUtils.replaceAll(s, "<a href=\"", "( ");
s = StringUtils.replaceAll(s, "\">", " ) ");
s = StringUtils.replaceAll(s, "</a>", "");
s = StringUtils.replaceAll(s, "<br />", "");
s = StringUtils.replaceAll(s, "<br/>", "");
s = StringUtils.replaceAll(s, "<br>", "");
if(s.indexOf('<') >= 0 || s.indexOf('>') >= 0) {
throw new Error("Unsupported HTML Tag: < or > in " + s);
......
......@@ -86,6 +86,31 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll test = new TestAll();
test.printSystem();
// improve TestHalt
// TODO backup : lobs are not backed up
// DROP TABLE IF EXISTS TEST;
// CREATE TABLE TEST(ID INT PRIMARY KEY, DATA CLOB);
// INSERT INTO TEST VALUES(1, space(10000));
// INSERT INTO TEST VALUES(2, 'World');
// drop table bar;
// drop table foo;
// create table FOO(id integer primary key);
// create table BAR(fooId integer);
// alter table bar add foreign key (fooid) references foo (id);
// truncate table bar;
// drop table FOO;
// create table FOO (ID int, A number(18, 2));
// insert into FOO (ID, A) values (1, 10.0), (2, 20.0);
// select SUM (CASE when ID=1 then 0 ELSE A END) col0 from Foo;
// hot backup: test, test encrypted database
// BACKUP: compare sql syntax with other databases
// Hot backup (incremental backup, online backup): backup data, log, index? files
// h2
// update FOO set a = dateadd('second', 4320000, a);
// ms sql server
......@@ -100,11 +125,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// test backup
// backup: lobs, index
// improve TestHalt
// BACKUP: compare sql syntax with other databases
// Hot backup (incremental backup, online backup): backup data, log, index? files
// GroovyServlet
// Cluster: hot deploy (adding a node on runtime)
......
......@@ -11,6 +11,7 @@ import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -82,8 +83,10 @@ public class GenerateDoc {
void map(String key, String sql) throws Exception {
ResultSet rs = null;
Statement stat = null;
try {
rs = conn.createStatement().executeQuery(sql);
stat = conn.createStatement();
rs = stat.executeQuery(sql);
ArrayList list = new ArrayList();
while(rs.next()) {
HashMap map = new HashMap();
......@@ -96,7 +99,7 @@ public class GenerateDoc {
String topic = rs.getString("TOPIC");
String syntax = rs.getString("SYNTAX");
syntax = PageParser.escapeHtml(syntax);
syntax = StringUtils.replaceAll(syntax, "<br>", "");
syntax = StringUtils.replaceAll(syntax, "<br />", "");
syntax = bnf.getSyntax(topic, syntax);
map.put("syntax", syntax);
list.add(map);
......@@ -104,6 +107,7 @@ public class GenerateDoc {
session.put(key, list);
} finally {
JdbcUtils.closeSilently(rs);
JdbcUtils.closeSilently(stat);
}
}
}
......@@ -47,9 +47,9 @@ public class MergeDocs {
String finalText= buff.toString();
File output = new File(baseDir, "onePage.html");
PrintWriter writer = new PrintWriter(new FileWriter(output));
writer.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><title>");
writer.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>");
writer.println("H2 Documentation");
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheetPdf.css\"></head><body>");
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheetPdf.css\" /></head><body>");
writer.println(finalText);
writer.println("</body></html>");
writer.close();
......
......@@ -89,9 +89,9 @@ public class XMLChecker {
private static void checkXML(String xml, boolean html) throws Exception {
String lastElement = null;
String[] noClose = new String[]{
"li", "link", "meta", "br", "img", "input", "hr", "frame"
};
// <li>: replace <li>([^\r]*[^<]*) with <li>$1</li>
// use this for html file, for example if <li> is not closed
String[] noClose = new String[]{};
XMLParser parser = new XMLParser(xml);
Stack stack = new Stack();
boolean rootElement = false;
......
......@@ -55,13 +55,13 @@ public class Doclet {
FileWriter out = new FileWriter(fileName);
PrintWriter writer = new PrintWriter(new BufferedWriter(out));
writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
writer.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><title>");
writer.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>");
writer.println(className);
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\"></head><body>");
writer.println("</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" /></head><body>");
writer.println("<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">");
writer.println("<h1>"+className+"</h1>");
writer.println(clazz.commentText()+"<br><br>");
writer.println(clazz.commentText()+"<br /><br />");
MethodDoc[] methods = clazz.methods();
Arrays.sort(methods, new Comparator() {
......@@ -117,7 +117,7 @@ public class Doclet {
continue;
}
if(fieldId==0) {
writer.println("<br><table><tr><th colspan=\"2\">Fields</th></tr>");
writer.println("<br /><table><tr><th colspan=\"2\">Fields</th></tr>");
}
String name = field.name();
String type = getTypeName(true, field.type());
......@@ -174,7 +174,7 @@ public class Doclet {
boolean space = false;
for(int j=0; j<paramTags.length; j++) {
if(!space) {
writer.println("<br><br >");
writer.println("<br /><br />");
space = true;
}
String p = paramTags[j].parameterName() + " - " + paramTags[j].parameterComment();
......@@ -186,7 +186,7 @@ public class Doclet {
Tag[] returnTags = method.tags("return");
if(returnTags != null && returnTags.length>0) {
if(!space) {
writer.println("<br><br >");
writer.println("<br /><br />");
space = true;
}
writer.println("<div class=\"itemTitle\">Returns:</div>");
......@@ -195,7 +195,7 @@ public class Doclet {
ThrowsTag[] throwsTags = method.throwsTags();
if(throwsTags != null && throwsTags.length > 0) {
if(!space) {
writer.println("<br><br >");
writer.println("<br /><br />");
space = true;
}
writer.println("<div class=\"itemTitle\">Throws:</div>");
......@@ -208,7 +208,7 @@ public class Doclet {
writer.println("<div class=\"item\">"+p+"</div>");
}
}
writer.println("<hr>");
writer.println("<hr />");
}
writer.println("</div></td></tr></table></body></html>");
writer.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论