嗨,我正在尝试执行查询
Statement stmt = conn.createStatement();
stmt.executeUpdate(location_query);
Run Code Online (Sandbox Code Playgroud)
location_query是
insert into table(col, col2) value("2", "");
Run Code Online (Sandbox Code Playgroud)
col和col2都是双(12,2)类型,我得到错误
Data truncated for column 'col2' at row 1
,但如果我打印我的查询并复制,并将其粘贴到PMA(PhpMyAdmin),它是正确的.
我猜测它的col2的值是空的,但有没有机会以其他方式解决这个问题,而不是检查我试图放入查询的所有变量?
嗨,我有这样的事情
package compot;
import java.util.Enumeration;
import gnu.io.*;
public class core {
private static SerialPort p;
/**
* @param args
*/
public static void main(String[] args)
{
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
System.out.println("start");
while(ports.hasMoreElements())
{
CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
System.out.print(port.getName() + " -> " + port.getCurrentOwner() + " -> ");
switch(port.getPortType())
{
case CommPortIdentifier.PORT_PARALLEL:
System.out.println("parell");
break;
case CommPortIdentifier.PORT_SERIAL:
//System.out.println("serial");
try {
p = (SerialPort) port.open("core", 1000);
int baudRate = 57600; // 57600bps
p.setSerialPortParams(
baudRate,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (PortInUseException e) …
Run Code Online (Sandbox Code Playgroud) http://jsfiddle.net/skowron_line/zPCBc/1/
var d1 = '31.05.2012';
var d2 = '01.06.2012';
var s1 = d1.split('.');
var s2 = d2.split('.');
var nd1 = new Date(s1[2], s1[1], s1[0]);
var nd2 = new Date(s2[2], s2[1], s2[0]);
$('#a').html(s1 + ' - '+ s2 +' = '+ nd2.getTime() +' - '+ nd1.getTime());
$('#b').html(
nd1.getFullYear() +'-'+ nd1.getMonth() +'-'+ nd1.getDate() +'<br />'+ nd2.getFullYear() +'-'+ nd2.getMonth() +'-'+ nd2.getDate()
);
Run Code Online (Sandbox Code Playgroud)
有人可以解释我的代码有什么问题吗?为什么31.05.2012
我等于01.06.2012
我想覆盖form_widget_simple
功能
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{% if errors|length > 0 %}
{{dump(form.vars.attr)}}
{% endif %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{% endspaceless %}
{% endblock form_widget_simple %}
Run Code Online (Sandbox Code Playgroud)
但我不知道如何设置form.vars.attr['class']
内部if
声明当我这样做set form.vars.attr['class'] = 'error';
我得到错误Unexpected token "punctuation" of value "." ("end of statement block" expected)