Это старая версия документа.



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/inc/parser/handler.php on line 1458

Warning: Declaration of syntax_plugin_tablecalc::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/lib/plugins/tablecalc/syntax.php on line 41

Warning: Declaration of syntax_plugin_tablecalc::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/lib/plugins/tablecalc/syntax.php on line 72

Warning: Declaration of syntax_plugin_offline::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/lib/plugins/offline/syntax.php on line 60

Warning: Declaration of syntax_plugin_offline::render($format, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/lib/plugins/offline/syntax.php on line 67

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3416 in /home/users/p/prom-auto/domains/prom-auto.ru/wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

<file java DemoScript2> import java.nio.charset.Charset; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.sql.Statement; import java.sql.ResultSet; import java.sql.PreparedStatement; import java.sql.Timestamp; public class DemoScript2 extends ScriptJava { Ref refLastDate; Ref refMsgText; Ref refMsgError; Ref refMsgSend; int time; String text; final static String dbname = "db"; Database db; boolean connected; @Override public boolean load() { time = getArg("time", 800); refLastDate = createRef("lastdate"); refMsgText = createRef("msg", "text"); refMsgError = createRef("msg", "error"); refMsgSend = createRef("msg", "send"); return true; } @Override public boolean prepare() { db = getDatabase(dbname); if (db == null) { printError("Database module is not found: " + dbname); return false; } connected = false; return true; } @Override public void execute() { if (db == null || !isValid()) return; if (!connected && db.isConnected()) { connected = true; init(); } if (connected && !db.isConnected()) { connected = false; } if (connected) update(); } /// init /// private void init() { // some code } /// update /// private void update() { try (Statement st = db.getConnection().createStatement()) { // some code String sql = "select * from users"; try (ResultSet rs = st.executeQuery(sql)) { // some code } // some code } catch (Exception e) { printError(e, "Request error"); } } } </file>

doc/jroboplc/modules/tagscript/javaexample2.1543826176.txt.gz · Последние изменения: 2018/12/03 11:36 — denis
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0