導航:首頁 > 源碼編譯 > 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社交網站源碼相關的資料

熱點內容
為什麼蘋果ipad連接不上伺服器 瀏覽:927
可樂app怎麼用卡密 瀏覽:766
路由器如何打開dhcp伺服器地址 瀏覽:75
谷歌圖片怎麼搜索app 瀏覽:863
江蘇文件夾模具廠 瀏覽:464
安卓系統網線攔截怎麼關閉 瀏覽:31
伺服器和終端是什麼 瀏覽:516
換安卓蘋果照片怎麼弄回去 瀏覽:260
如何向ca中心申請伺服器 瀏覽:187
從java到Android 瀏覽:551
福建加密app哪個好用 瀏覽:382
opengl游戲編程徐明亮pdf 瀏覽:619
單片機row怎麼用 瀏覽:981
虛函數表與反編譯 瀏覽:134
網上的滴滴搶單app是怎麼做的 瀏覽:384
eve手游ios賬號怎麼登錄安卓的 瀏覽:622
linuxoracle12安裝教程 瀏覽:697
凱迪仕cpu動態加密 瀏覽:751
dell伺服器如何啟動 瀏覽:968
數字信號處理第三版pdf 瀏覽:684