社区
JavaScript
帖子详情
ibatis如何返回timestamp类型的数据
Freak_Van
2017-10-10 10:08:52
我需要将表中的BEGIN和END字段最好以yyyy-MM-dd hh:mm:ss这个格式显示
因为是前端封装好的方法,所以我没办法在controller那里改好格式再返回数据,有大神知道怎么能修改下sql语句可以实现我的需求吗?感激不尽!!!
...全文
203
回复
打赏
收藏
ibatis如何返回timestamp类型的数据
我需要将表中的BEGIN和END字段最好以yyyy-MM-dd hh:mm:ss这个格式显示 因为是前端封装好的方法,所以我没办法在controller那里改好格式再返回数据,有大神知道怎么能修改下sql语句可以实现我的需求吗?感激不尽!!!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
java业务层框架开发
ibatis
(java源码)
// JBuilder API Decompiler stub source generated from class file // 2010-1-15 // -- implementation of methods is not available package com.
ibatis
.common.jdbc; // Imports import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Savepoint; import java.sql.Statement; import java.util.Map; public class SimplePooledConnection implements InvocationHandler { // Fields private static final String CLOSE = "close"; private static final Class[] IFACES; private int hashCode; private SimpleDataSource dataSource; private Connection realConnection; private Connection proxyConnection; private long checkout
Timestamp
; private long created
Timestamp
; private long lastUsed
Timestamp
; private int connectionTypeCode; private boolean valid; // Constructors public SimplePooledConnection(Connection connection, SimpleDataSource dataSource) { } // Methods public void invalidate() { } public boolean isValid() { return false;} public Connection getRealConnection() { return null;} public Connection getProxyConnection() { return null;} public int getRealHashCode() { return 0;} public int getConnectionTypeCode() { return 0;} public void setConnectionTypeCode(int connectionTypeCode) { } public long getCreated
Timestamp
() { return 0L;} public void setCreated
Timestamp
(long created
Timestamp
) { } public long getLastUsed
Timestamp
() { return 0L;} public void setLastUsed
Timestamp
(long lastUsed
Timestamp
) { } public long getTimeElapsedSinceLastUse() { return 0L;} public long getAge() { return 0L;} public long getCheckout
Timestamp
() { return 0L;} public void setCheckout
Timestamp
(long
timestamp
) { } public long getCheckoutTime() { return 0L;} private Connection getValidConnection() { return null;} public int hashCode() { return 0;} public boolean equals(Object obj) { return false;} public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return null;} public Statement createStatement() throws SQLException { return null;} public PreparedStatement prepareStatement(String sql) throws SQLException { return null;} public CallableStatement prepareCall(String sql) throws SQLException { return null;} public String nativeSQL(String sql) throws SQLException { return null;} public void setAutoCommit(boolean autoCommit) throws SQLException { } public boolean getAutoCommit() throws SQLException { return false;} public void commit() throws SQLException { } public void rollback() throws SQLException { } public void close() throws SQLException { } public boolean isClosed() throws SQLException { return false;} public DatabaseMetaData getMetaData() throws SQLException { return null;} public void setReadOnly(boolean readOnly) throws SQLException { } public boolean isReadOnly() throws SQLException { return false;} public void setCatalog(String catalog) throws SQLException { } public String getCatalog() throws SQLException { return null;} public void setTransactionIsolation(int level) throws SQLException { } public int getTransactionIsolation() throws SQLException { return 0;} public SQLWarning getWarnings() throws SQLException { return null;} public void clearWarnings() throws SQLException { } public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { return null;} public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return null;} public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return null;} public Map getTypeMap() throws SQLException { return null;} public void setTypeMap(Map map) throws SQLException { } public void setHoldability(int holdability) throws SQLException { } public int getHoldability() throws SQLException { return 0;} public Savepoint setSavepoint() throws SQLException { return null;} public Savepoint setSavepoint(String name) throws SQLException { return null;} public void rollback(Savepoint savepoint) throws SQLException { } public void releaseSavepoint(Savepoint savepoint) throws SQLException { } public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null;} public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null;} public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null;} public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { return null;} public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { return null;} public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { return null;} }
iBATIS
date MySQL_
timestamp
,datetime
数据
类型
在
ibatis
中
[看完这篇文章的第一感觉是,虽然对于日期
类型
数据
使用得很算顺利,不过作者 提到的一些东西还真不知道。有时候在应用上,不觉得比老外差到那里去。但是, 老外的一个优良mysql
数据
库字段为
timestamp
或datetime
类型
,在
ibatis
中不知道怎么配置,[ Cannot convert value '0000-00-00 00:00:00' to
TIMESTAMP
今天在用java的J...
JDBC和
Ibatis
中的Date,Time,
Timestamp
处理
在此前,遇到过使用
Ibatis
操作Oracle时时间精度丢失的问题,昨天又遇到JDBC操作MySQL时间字段的问题,从网上看到各种式样的解释这些问题的博文/帖子,但多是雾里看花,不得要领。 理解JDBC中的时间
类型
MySQL与JDBC之间的
类型
映射Oracle与JDBC之间的
类型
映射
Ibatis
是怎么处理日期时间
类型
的注释参考资料 理解JDBC中的时间
类型
java.sql包中包括三
ibatis
mysql date_
timestamp
,datetime
数据
类型
在
ibatis
中
mysql
数据
库字段为
timestamp
或datetime
类型
,在
ibatis
中不知道怎么配置,我用java.util.Date,和java.sql.
Timestamp
都试过,都不行,不知道怎么解决,有人知道吗?谢谢!import java.util.Date;public class Forum {private Long forumId;private String name;private ...
PostgreSQL在java中
timestamp
和String
类型
的相互转化
首先上代码: to_char(date, 'yyyy-mm-dd HH:ii:ss') as "date" 当pgsql中查询的是
timestamp
类型
的时间对象,而java实体类中的时间对象是String
类型
,则可以用这个函数实现转化。把代码中的date换成查询的字段,然后用as取个别名就好了。 to_
timestamp
(date,'yyyy-MM-dd hh24:mi:ss') 这...
JavaScript
87,907
社区成员
224,614
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章