Results 1 to 17 of 17
Thread: Netbeans - usera
Hybrid View
-
13th April 2007 15:27 #1Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
Netbeans - usera
, User-a : "catch (SQLException ex) { }" ?
"Message Group"
!
Last edited by Nach40; 13th April 2007 at 15:29. Reason:
-
13th April 2007 17:08 #2
-
15th April 2007 17:17 #3Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
, /.
user-a , , .. , !
. Form-a.
-
15th April 2007 19:23 #4
Join Date: Jun:2002
Location: 85435
Posts: 4,619
, JDialog, . , .
X570 Aorus Elite || R5 3600x || NH-D14 || 32GB RAM || GTX1070Ti Ultra Silent || PCE-AC56 || 850 EVO+MP510+HDDs || SSR-650RT all in Dark Base 900 || EV2736W || G29 || Obutto Ozone+Sparco R333
-
16th April 2007 16:43 #5Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
!
A Validator User DB ?
-
17th April 2007 10:26 #6
SQLException. ( netbeans), - 2 (user pass), boolean. users true false...
Thre are 10 kinds of people in this world - people who know binary, and those who don't.
-, .
-
18th April 2007 13:56 #7Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
, !
: " Update MySQL , ?
try {
StringBuilder builder = new StringBuilder();
builder.append("update users ");
builder.append("set UserPassword= <-- , ?
builder.append("where Username=? and UserPassword=?");Last edited by Nach40; 18th April 2007 at 13:58. Reason:
-
18th April 2007 21:34 #8
web jsp/servlet-. jsp html password . jsp, html String newpass = request.getParameter(" password "); update-a . where primary key-a . . primary key-a session ...
Thre are 10 kinds of people in this world - people who know binary, and those who don't.
-, .
-
18th April 2007 21:45 #9
Join Date: Jun:2002
Location: 85435
Posts: 4,619
1. - Java sql
2. sql Java.
sql , !?
Java?
EDIT: :
1.
jdbc.drivers=org.gjt.mm.mysql.Driver
jdbc.url=jdbc:mysql://localhost:3306/
jdbc.username= ,
jdbc.password=
2. sql-
public static Connection getConnection() throws SQLException, IOException
{
Properties props = new Properties();
FileInputStream in = new FileInputStream(" -");
props.load(in);
in.close();
String drivers = props.getProperty("jdbc.drivers");
if (drivers != null)
System.setProperty("jdbc.drivers", drivers);
String url = props.getProperty("jdbc.url");
String username = props.getProperty("jdbc.username");
String password = props.getProperty("jdbc.password");
return DriverManager.getConnection(url, username, password);
}
3. , sql
Connection conn = getConnection();
Statement stat = conn.createStatement();
"execute" "executeQuery".
4. .
Last edited by Satanail; 18th April 2007 at 22:03.
X570 Aorus Elite || R5 3600x || NH-D14 || 32GB RAM || GTX1070Ti Ultra Silent || PCE-AC56 || 850 EVO+MP510+HDDs || SSR-650RT all in Dark Base 900 || EV2736W || G29 || Obutto Ozone+Sparco R333
-
19th April 2007 00:47 #10Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
!!!, !
, , !
web(Visual Web Application) jsp/servlet-, , ,, String-, Update-!
( koshera) : " update-a ." * ( 4 , Set?
( "where Username=? and UserPassword=?")
usera "", !
-!!!Last edited by Nach40; 19th April 2007 at 00:50. Reason:
-
19th April 2007 13:37 #11
Satanail / java . jdbc .
mysql
http://marakana.com/blog/examples/ja...operation.html
update executeUpdate, executeQuerry .
Edit:
...
StringBuilder builder = new StringBuilder();
builder.append("update users ");
builder.append("set UserPassword=" + newpass);
builder.append("where Username=? and UserPassword=?");
...
con = DriverManager.getConnection(DB_CONNECTIO N_STRING,DB_USERNAME,DB_PASSWORD);
Statement stmt = con.createStatement();
int res= stmt.executeUpdate(builder.toString());Last edited by koshera; 19th April 2007 at 13:46.
Thre are 10 kinds of people in this world - people who know binary, and those who don't.
-, .
-
20th April 2007 00:09 #12Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
:
builder = new StringBuilder();
builder.append(" update users ");
builder.append("set UserPassword='"+newpass+"' ");
builder.append("where UserName=?");
statement = connection.prepareStatement(builder.toSt ring());
statement.setString(1, (String) nickname.getValue());
statement.executeUpdate();
:
set :
builder.append("set UserPassword=(aes_encrypt('text' '"+confpass+"')) ");
,, !?
:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'UserPassword' at row 1
, !
!!!Last edited by Nach40; 23rd April 2007 at 18:06.
-
20th April 2007 00:18 #13
Join Date: Jun:2002
Location: 85435
Posts: 4,619
. . , . - SSL, (MD5( , ), Base64, etc.). - , , , , SSL SQL-. , , .
X570 Aorus Elite || R5 3600x || NH-D14 || 32GB RAM || GTX1070Ti Ultra Silent || PCE-AC56 || 850 EVO+MP510+HDDs || SSR-650RT all in Dark Base 900 || EV2736W || G29 || Obutto Ozone+Sparco R333
-
20th April 2007 00:40 #14
:
1. UserPassword varchar(1) 1. varchar(20) .
2. java SQL - php - PreparedStatement jdbc - - .
3. java (").
-
21st April 2007 12:47 #15Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
. ( Hardwarebg, !) User !
, !
( - ). , ....
.
Annihilator: "text" "blob" !
, ( , User-a Pass-a , . , !):
StringBuilder builder = new StringBuilder();
builder.append("select UserPassword ");<-- builder.append("select aes_decrypt(UserPassword,\'text\') ");
builder.append("from users ");
builder.append("where UserName=? and UserPassword=?");
statement = connection.prepareStatement(builder.toSt ring());
statement.setString(1, (String) nickname.getValue());
statement.setString(2, (String) oldpassword.getValue());
rst = statement.executeQuery();
if(!rst.next()) {
info(" User ! ");
}else{
log("nickname and oldpassword are OK ");
-----------------------------------------------------------
SQL !!!
PreparedStatement jdbc?
!
!Last edited by Nach40; 21st April 2007 at 16:14.
-
22nd April 2007 01:03 #16
http://today.java.net/download/jdk6/...Statement.html
.
- , - . , .
- MySQL password, , , .
- , .
, md5 hash String.
Code:public static String hashPassword(String password) { String hashword = null; try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(password.getBytes()); BigInteger hash = new BigInteger(1, md5.digest()); hashword = hash.toString(16); } catch (NoSuchAlgorithmException nsae) { nsae.printStackTrace(); } return hashword; }
- - - , , blob .
-
23rd April 2007 18:05 #17Registered User
Join Date: Nov:2005
Location: Bulgaria
Posts: 52
!!!
.
!
.....




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in