導航:首頁 > 數據處理 > 表單怎麼保存資料庫

表單怎麼保存資料庫

發布時間:2023-09-02 21:33:02

Ⅰ 如何把excel表格數據導入到資料庫

1、打開SQL Server 2014 Management Studio 資料庫,並且登錄進去;

Ⅱ 表單的內容如何存入資料庫中

EXECL表中的數據導入資料庫並不難!
1、要懂得資料庫知識,並建有相關的可用於存儲該數據的表。
2、可以編程,直接讀取EXECL表單中數據,使用SQL寫入資料庫。
3、可以將EXECL另存為文本格式,然後使用BCP或者使用資料庫相關工具或軟體,將文件內容導入資料庫。

Ⅲ excel 表格存儲到資料庫

這里以SQL SERVE2008為例。SQLSERVER2008有一個「數據導入導出功能」,當然我們也可以打開資料庫之後,在資料庫上點擊右鍵,然後選擇「任務」,選擇「導入數據」,我們就看到彈出淡入數據的對話框:

Ⅳ 如何將JSP頁面中的表單信息保存到Mysql資料庫

獲取表單中的信息,然後插入到Mysql中
<%@pagelanguage="java"contentType="text/html;charset=gbk"
鏈桐亮pageEncoding="gbk"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<%
intid=Integer.parseInt(request.getParameter("id"));
introotid=Integer.parseInt(request.getParameter("rootid"));

%>

<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gbk">
<title>Replay</title>
</head>
<body>
<formmethod="post"action="ReplayOK.jsp">
<inputtype="hidden"name="id"value="<%=id%>">
<inputtype="hidden"name="rootid"value="<%=rootid%>">
<tablealign="center">
<tr>
<td>
<inputtype="text"name="title"size="80">
</td>
</tr>

<tr>
<td>
<textareacols="80"rows="20"name="cont"></textarea>
</td>
</tr>

<tr>
<td>
<inputtype="submit"value="提交">
</td>
</tr>
</table>
</form>
</body>
</html>

---------------------------------------------------------------
下面接收上面表單中傳過來的信息,並插入到mysql中

<%@棚寬pagelanguage="java"contentType="text/html;charset=gbk"
pageEncoding="gbk"%>
<%@pageimport="輪前java.sql.*"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<%
request.setCharacterEncoding("GBK");
intid=Integer.parseInt(request.getParameter("id"));
introotid=Integer.parseInt(request.getParameter("rootid"));
Stringtitle=request.getParameter("title");
Stringcont=request.getParameter("cont").replaceAll(" ","<br/>");

Connectionconn=null;
Statementst=null;

Class.forName("com.mysql.jdbc.Driver");
conn=DriverManager.getConnection("jdbc:mysql://localhost/bbs?user=root&password=690115399");
st=conn.createStatement();

conn.setAutoCommit(false);

Stringsql="insertintoarticlevalues(null,?,?,?,?,now(),0)";
PreparedStatementpstmt=conn.prepareStatement(sql);
pstmt.setInt(1,id);
pstmt.setInt(2,rootid);
pstmt.setString(3,title);
pstmt.setString(4,cont);
pstmt.executeUpdate();

st.executeUpdate("updatearticlesetisleaf=1whereid="+id);

conn.commit();
conn.setAutoCommit(true);

st.close();
pstmt.close();
conn.close();
%>

<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gbk">
<title>Inserttitlehere</title>
</head>
<body>
<%response.sendRedirect("ShowArticleTree.jsp");%>
</body>
</html>
當然最好的方法還是應該用jsp+JavaBean方式。

閱讀全文

與表單怎麼保存資料庫相關的資料

熱點內容
吉事辦個人信息如何更改 瀏覽:796
牛奶祛痘痘產品有哪些 瀏覽:233
反映信息的技術是什麼 瀏覽:266
qq有多少個地方泄露信息 瀏覽:259
亞太罐頭代理公司怎麼樣 瀏覽:656
咸陽西關舊貨市場有哪些 瀏覽:975
ps如何邊看數據邊修圖 瀏覽:101
滬深a股交易規則有哪些 瀏覽:496
百貨公司如何申請支付寶小程序 瀏覽:652
在網上代理什麼合適 瀏覽:328
sock4代理干什麼用 瀏覽:485
如何給產品配圖案 瀏覽:418
穿孔石有哪些產品 瀏覽:675
交易系統買點怎麼選擇 瀏覽:801
如何通過現有資源推廣產品 瀏覽:957
如何講解技術方案 瀏覽:327
怎麼關閉手機應用程序 瀏覽:158
如何消除理財產品 瀏覽:311
程序員和工廠有什麼不同 瀏覽:117
寧波哪個市場賣家用開關插座的 瀏覽:757