Monday, July 23, 2012

Java call procedure and get cursor back


//getDBUSERCursor is a stored procedure
String getDBUSERCursorSql = "{call getDBUSERCursor(?,?)}";
callableStatement = dbConnection.prepareCall(getDBUSERCursorSql);
callableStatement.setString(1, "mkyong");
callableStatement.registerOutParameter(2, OracleTypes.CURSOR);
 
// execute getDBUSERCursor store procedure
callableStatement.executeUpdate();
 
// get cursor and cast it to ResultSet
rs = (ResultSet) callableStatement.getObject(2);
 
// loop it like normal
while (rs.next()) {
 String userid = rs.getString("USER_ID");
 String userName = rs.getString("USERNAME");
}

Wednesday, June 13, 2012

HTML5 的 cache 設定

1. Add mime type for tomcat or web server

   
manifest
text/cache-manifest
   

2. HTML file
<  ! DOCTYPE    h t m l >
< h t m l    m a n i f e s t = " " >

3. cache.manifest


CACHE MANIFEST
CACHE:
/styles/m/mobile-css.css
/js/jquery/jquery-1.4.2.min.js
/styles/m/jquery.zweatherfeed.css
/scripts/m/jquery.zweatherfeed.min.js
/images/m/logo.jpg
/images/m/pic.jpg
NETWORK:
*
FALLBACK:
index.jsp


Wednesday, March 7, 2012

SQL Server Error: 防止儲存需要資料表重建的變更

出現錯誤訊息:『防止儲存需要資料表重建的變更』 解決方法其實很簡單:工具 - 選項 - Designers;把 防止儲存需要資料表重建的變更,打勾取消掉,

就可以了 如下圖