jquery怎么从数据库中取DIV数据(位置宽高)显示在页面中
div的css属性内容都是在数据库里的<%Stringdriver="com.mysql.jdbc.Driver";Stringuser="root";Stringpas...
div的css属性 内容都是在数据库里的
<% String driver = "com.mysql.jdbc.Driver";
String user = "root";
String password = "123456";
String db = "zhhb";
String table = "div";
String url = "jdbc:mysql://localhost:3306/" + db + "?user=" + user
+ "&password=" + password + "characterEncoding=gb2312";
Class.forName(driver).newInstance();
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
String sql = "selcet * from" + table;
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
String div_ = "<div style='posstion=" + rs.getString("posstion") + ";left=" + rs.getString("left") + ";top="+ rs.getString("top") + ";width="+ rs.getString("width") + ";hight="+ rs.getString("hight") + ";z-index=" + rs.getString("z-index") + ";visible="+ rs.getString("visible") + ";backgroundcolor=" + rs.getString("backgroudcolor") + ";'>";
String content = rs.getString("content");
String _div = "</div>"; }
rs.close();
stmt.close();
conn.close();%>
这个是jsp的代码 展开
<% String driver = "com.mysql.jdbc.Driver";
String user = "root";
String password = "123456";
String db = "zhhb";
String table = "div";
String url = "jdbc:mysql://localhost:3306/" + db + "?user=" + user
+ "&password=" + password + "characterEncoding=gb2312";
Class.forName(driver).newInstance();
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
String sql = "selcet * from" + table;
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
String div_ = "<div style='posstion=" + rs.getString("posstion") + ";left=" + rs.getString("left") + ";top="+ rs.getString("top") + ";width="+ rs.getString("width") + ";hight="+ rs.getString("hight") + ";z-index=" + rs.getString("z-index") + ";visible="+ rs.getString("visible") + ";backgroundcolor=" + rs.getString("backgroudcolor") + ";'>";
String content = rs.getString("content");
String _div = "</div>"; }
rs.close();
stmt.close();
conn.close();%>
这个是jsp的代码 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询