字符类型检查:如果不允许特殊字符,那么就用一些特殊字符、负数并确保系统提示正确的出错信息。
Character type checking: If special character is not allowed then give some special character, negative values and make sure proper error message has been thrown by the system.
要将电话类型从整数扩展为字符串是一件很容易的事,虽然这样做将会为服务检查输入的数据带来一些工作量。
It's an easy matter to expand the phone types from ints to strings, although it will be a bit more work for your service to validate the incoming strings.
很不幸的是,JDBC 的访问 SQL 的方法丢失了类型安全,因为这是一个调用级别的接口,因此它限制只有在运行时才能检查字符串。
Type safety is sadly missing from JDBC's approach to accessing SQL, by the way, because it is a call-level interface and is thus restricted to strings that can only be checked at runtime.
应用推荐