java语句向数据库添加数据,怎么使用表的默认值

2025-02-02 20:51:20
推荐回答(2个)
回答1:

public int getTextWidth(String text, Paint paint) {
Rect bounds = new Rect();
paint.getTextBounds(text, 0, text.length(), bounds);
int width = bounds.left + bounds.width();
return width;
}
public int getTextHeight(String text, Paint paint) {
Rect bounds = new Rect();
paint.getTextBounds(text, 0, text.length(), bounds);
int height = bounds.bottom + bounds.height();
return height;
}

回答2:

具有默认值的字段在插入的时候不插就可以了