導航:首頁 > 源碼編譯 > jsp社交網站源碼

jsp社交網站源碼

發布時間:2024-05-22 22:39:47

㈠ 網頁源代碼是什麼

1、源碼是使用html編寫的,通過IE把它翻譯為網頁,它是所有網頁的核心,但是html 並不是計算機語言,只是網頁的另一種描述.源代碼是一種語言,組織排版網頁上的元素(圖片,視頻,音樂,文字等)的一種標准語言。 2、如果您要製作網頁,您可以選用如Frontpage或Dreamwaver等工具,這些工具都是所見即所得性質的,就是說您在工具界而上製作的,就能直接在瀏覽中原樣顯示出來。但,這些工具同時還提供了源代碼視圖,也就是說,如果一些功能沒有辦法直接通過工具來實現,那你要編輯源代碼了。 3、當然,您也可以直接用記事本來編輯網頁,直接輸入代碼,然後另存為.htm或.asp或其他為後綴名的文件。您保存下來的這些文件就是網頁了,而您在記事本里編輯的那些,就是源代碼。

㈡ jsp登陸界面源代碼

login.jsp文件

<%@ page language="java" contentType="text/html; charset=GB18030"

pageEncoding="GB18030"%>

<%@ page import="java.util.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>登錄頁面</title>

</head>

<body>

<form name="loginForm" method="post" action="judgeUser.jsp">

<table>

<tr>

<td>用戶名:<input type="text" name="userName" id="userName"></td>

</tr>

<tr>

<td>密碼:<input type="password" name="password" id="password"></td>

</tr>

<tr>

<td><input type="submit" value="登錄" style="background-color:pink"> <input

type="reset" value="重置" style="background-color:red"></td>

</tr>

</table>

</form>

</body>

</html>

Data_uil.java文件代碼:

import java.sql.*;

public class Data_uil

{

public Connection getConnection()

{

try{

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

}catch(ClassNotFoundException e)

{

e.printStackTrace();

}

String user="***";

String password="***";

String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=***";

Connection con=null;

try{

con=DriverManager.getConnection(url,user,password);

}catch(SQLException e)

{

e.printStackTrace();

}

return con;

}

public String selectPassword(String username)

{

Connection connection=getConnection();

String sql="select *from login where username=?";

PreparedStatement preparedStatement=null;

ResultSet result=null;

String password=null;

try{

preparedStatement=connection.prepareStatement(sql);

preparedStatement.setString(1,username);


result=preparedStatement.executeQuery();//可執行的 查詢

if(result.next())

password=result.getString("password");


}catch(SQLException e){

e.printStackTrace();

}finally

{

close(preparedStatement);

close(result);

close(connection);

}

System.out.println("找到的資料庫密碼為:"+password);

return password;

}

public void close (Connection con)

{

try{

if(con!=null)

{

con.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

public void close (PreparedStatement preparedStatement)

{

try{

if(preparedStatement!=null)

{

preparedStatement.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

public void close(ResultSet resultSet)

{

try{

if(resultSet!=null)

{

resultSet.close();

}

}catch(SQLException e)

{

e.printStackTrace();

}

}

}

閱讀全文

與jsp社交網站源碼相關的資料

熱點內容
演算法設計與分析基礎網盤 瀏覽:709
linux信號量的使用 瀏覽:58
朴初炫演過的電影 瀏覽:967
掌閱下的書在哪個文件夾 瀏覽:849
程序員學python難嗎 瀏覽:735
源泉插件圖紙加密 瀏覽:607
minitab編程 瀏覽:229
網頁編程語言大全 瀏覽:631
單片機鋰離子 瀏覽:7
單片機交流電流測量 瀏覽:715
小雞模擬器ios游戲一直正在解壓 瀏覽:926
可以把文件夾轉化為文檔的軟體 瀏覽:954
微軟認證高級程序員 瀏覽:885
人工智慧網路演算法工程師 瀏覽:459
白色邊框app是什麼 瀏覽:740
日本愛情尺寸度電影推薦 瀏覽:935
國內女人偷情片 瀏覽:287
姜恩惠演的電影 瀏覽:198
高清免費觀看電影大全 瀏覽:782
電影在線高清免費觀看 瀏覽:374