将word在后台转换为htm,将htm内容传到前台,在editor内面通过html方式加载该内容。。。
保存:
将editor内容保存为htm文件,将htm文件转化为doc。。。
你可以用MVC做进去哦连接数据库。。。
package cn.qbe.util
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.sql.Connection
import java.sql.DriverManager
import java.sql.ResultSet
import java.sql.SQLException
import java.sql.Statement
import java.util.Properties
public class JDBCUtil {
private static String driver
private static String url
private static String user
private static String password
static{
Properties p = new Properties()
try {
FileInputStream fis =
new FileInputStream("C:/Documents and Settings/Administrator/workspace/messageOnLine/WebRoot/properties/JdbcConfig.properties")
p.load(fis)
driver = p.getProperty("driver")
url = p.getProperty("url")
user = p.getProperty("user")
password = p.getProperty("password")
} catch (Exception e) {
e.printStackTrace()
}
}
public static Connection getConnection() {
Connection conn = null
try {
Class.forName(driver)
conn = DriverManager.getConnection(url, user, password)
} catch (Exception e) {
System.out.println("数据库连接出现异常:" + e)
}
return conn
}// getConnection
public static void close(ResultSet rs, Statement stmt, Connection conn) {
try {
if(rs!=null){
rs.close()
}
} catch (SQLException e) {
System.out.println("关闭ResultSet对象出现异常:"+e)
e.printStackTrace()
}finally{
try {
if(stmt!=null){
stmt.close()
}
} catch (SQLException e) {
System.out.println("关闭Statement对象出现异常:"+e)
e.printStackTrace()
}finally{
try {
if(conn!=null){
conn.close()
}
} catch (SQLException e) {
System.out.println("关闭Connection对象出现异常:"+e)
e.printStackTrace()
}
}
}
}// close
}
你自己看看
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)