如何使用MySQL Workbench进行数据库备份?我们可以通过以下方式进行备份 -
我试图text/plain通过互联网逐行读取文件.我现在的代码是:
URL url = new URL("http://kuehldesign.net/test.txt");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
LinkedList<String> lines = new LinkedList();
String readLine;
while ((readLine = in.readLine()) != null) {
lines.add(readLine);
}
for (String line : lines) {
out.println("> " + line);
}
Run Code Online (Sandbox Code Playgroud)
该文件test.txt包含¡Hélló!,我正在使用它来测试编码.
当我查看OutputStream(out)时,我将其视为> ¬°H?©ll??!.我不相信这是一个问题,OutputStream因为我可以out.println("é");没有问题.
阅读的任何想法都形成InputStreamUTF-8?谢谢!
配置Spring Security 3.2后,_csrf.token不会绑定请求或会话对象.
这是spring security配置:
<http pattern="/login.jsp" security="none"/>
<http>
<intercept-url pattern="/**" access="ROLE_USER"/>
<form-login login-page="/login.jsp"
authentication-failure-url="/login.jsp?error=1"
default-target-url="/index.jsp"/>
<logout/>
<csrf />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="test" password="test" authorities="ROLE_USER/>
</user-service>
</authentication-provider>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)
login.jsp文件
<form name="f" action="${contextPath}/j_spring_security_check" method="post" >
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<button id="ingresarButton"
name="submit"
type="submit"
class="right"
style="margin-right: 10px;">Ingresar</button>
<span>
<label for="usuario">Usuario :</label>
<input type="text" name="j_username" id="u" class="" value=''/>
</span>
<span>
<label for="clave">Contraseña :</label>
<input type="password"
name="j_password"
id="p"
class=""
onfocus="vc_psfocus = 1;"
value="">
</span>
</form>
Run Code Online (Sandbox Code Playgroud)
它呈现下一个HTML:
<input type="hidden" name="" …Run Code Online (Sandbox Code Playgroud) while在Java中查看以下无限循环.它会导致它下面的语句出现编译时错误.
while(true) {
System.out.println("inside while");
}
System.out.println("while terminated"); //Unreachable statement - compiler-error.
Run Code Online (Sandbox Code Playgroud)
以下相同的无限while循环,但工作正常,并不会发出任何错误,我只是用布尔变量替换条件.
boolean b=true;
while(b) {
System.out.println("inside while");
}
System.out.println("while terminated"); //No error here.
Run Code Online (Sandbox Code Playgroud)
在第二种情况下,循环后的语句显然无法访问,因为布尔变量b为true,编译器根本不会抱怨.为什么?
编辑:下面的版本while陷入了无限循环,但是对于它下面的语句没有发出编译器错误,即使if循环中的条件总是false因此,循环也永远不会返回并且可以由编译器在编译时本身.
while(true) {
if(false) {
break;
}
System.out.println("inside while");
}
System.out.println("while terminated"); //No error here.
Run Code Online (Sandbox Code Playgroud)
while(true) {
if(false) { //if true then also
return; //Replacing return with break fixes the following error.
}
System.out.println("inside while");
}
System.out.println("while terminated"); //Compiler-error - unreachable statement. …Run Code Online (Sandbox Code Playgroud) 可能重复:
为什么Oracle 9i将空字符串视为NULL?
我在Oracle 10g中的表命名TEMP_TABLE,只有两列- id和description只为示范的缘故.
该列id是序列生成的类型主键,NUMBER(35, 0) not null列DESCRIPTION是其类型VARCHAR2(4000) not null.
在这种情况下,基本的表结构如下所示.
+--------------+-----------+---------------+
|Name | Null? | Type |
+--------------+-----------+---------------+
|ID | NOT NULL | NUMBER(35) |
|DESCRIPTION | NOT NULL | VARCHAR2(4000)|
+--------------+-----------+---------------+
Run Code Online (Sandbox Code Playgroud)
创建此表后,我尝试INSERT交替插入以下命令.
INSERT INTO temp_table (id, description) VALUES (1, null); ->unsuccessful
INSERT INTO temp_table (id, description) VALUES (2, ''); ->unsuccessful
Run Code Online (Sandbox Code Playgroud)
它们都不成功,因为not null在DESCRIPTION列上强制执行约束.
在这两种情况下,Oracle都抱怨道
ORA-01400: cannot insert NULL …Run Code Online (Sandbox Code Playgroud) 是否可以<tr>一次性对表行进行边界处理,而不是为单个单元格设置边框,<td>例如,
<table cellpadding="0" cellspacing="0" width="100%" style="border: 1px;" rules="none">
<tbody>
<tr>
<th style="width: 96px;">Column 1</th>
<th style="width: 96px;">Column 2</th>
<th style="width: 96px;">Column 3</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="border-left: thin solid; border-top: thin solid; border-bottom: thin solid;"> </td>
<td style="border-top: thin solid; border-bottom: thin solid;"> </td>
<td style="border-top: thin solid; border-bottom: thin solid; border-right: thin solid;"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>Run Code Online (Sandbox Code Playgroud)
这给出了给定边界的边界,<tr>但它需要围绕单个单元格的边界.
我们可以<tr>一次性给一个边界吗?
有没有人熟悉在Apache POI 3.7创建的电子表格中锁定行的方法?通过锁定,我的意思是当用户滚动行时,我希望列的标题行保持可见.我创建的电子表格将有500行,如果列的名称始终可见,将会很有用.
这是一个采访问题:
public class Demo {
public static void main(String[] args) {
System.out.println(foo());
}
static String foo() {
try {
return "try ...";
} catch (Exception e) {
return "catch ...";
} finally {
return "finally ..."; //got as result
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是为什么没有编译时错误.当我在finally块中有return语句时,它必然会从而finally不是try和catch块返回.我尝试使用-Xlint选项编译此代码,它会发出警告.
warning: [finally] finally clause cannot complete normally
Run Code Online (Sandbox Code Playgroud) 对于CakePHP应用程序,我创建了MySQL数据库.
用于创建数据库ER图的工具?表格之间的字段和关系以cakePHP喜欢的方式创建.
先感谢您!
mysql cakephp er-diagrams reverse-engineering mysql-workbench
java ×4
css ×2
html ×2
mysql ×2
apache-poi ×1
border ×1
cakephp ×1
csrf ×1
database ×1
er-diagrams ×1
html-table ×1
inputstream ×1
null ×1
oracle ×1
oracle10g ×1
return ×1
spring ×1
string ×1
try-catch ×1
utf-8 ×1