Results 1 to 17 of 17

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Nov:2005
    Location: Bulgaria
    Posts: 52

    Cool Netbeans - usera

    , User-a : "catch (SQLException ex) { }" ?
    "Message Group"

    !
    Last edited by Nach40; 13th April 2007 at 15:29. Reason:

  2. #2
    XaMaB's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 20,387
    ?
    : XaMaB; . 0.42

    In God we Trust (all others must submit a X.509 certificate). , ()

  3. #3
    Registered User
    Join Date: Nov:2005
    Location: Bulgaria
    Posts: 52

    Wink

    , /.
    user-a , , .. , !
    . Form-a.

  4. #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

  5. #5
    Registered User
    Join Date: Nov:2005
    Location: Bulgaria
    Posts: 52
    !
    A Validator User DB ?

  6. #6
    ****** koshera's Avatar
    Join Date: Sep:2003
    Location: Sammamish, WA, USA
    Posts: 1,507
    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.
    -, .

  7. #7
    Registered 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:

  8. #8
    ****** koshera's Avatar
    Join Date: Sep:2003
    Location: Sammamish, WA, USA
    Posts: 1,507
    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.
    -, .

  9. #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

  10. #10
    Registered 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:

  11. #11
    ****** koshera's Avatar
    Join Date: Sep:2003
    Location: Sammamish, WA, USA
    Posts: 1,507
    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.
    -, .

  12. #12
    Registered 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.

  13. #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

  14. #14
    Registered User Annihilator's Avatar
    Join Date: Jun:2004
    Location: Sofia
    Posts: 1,316
    :
    1. UserPassword varchar(1) 1. varchar(20) .
    2. java SQL - php - PreparedStatement jdbc - - .
    3. java (").

  15. #15
    Registered 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.

  16. #16
    Registered User Annihilator's Avatar
    Join Date: Jun:2004
    Location: Sofia
    Posts: 1,316
    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 .

  17. #17
    Registered User
    Join Date: Nov:2005
    Location: Bulgaria
    Posts: 52
    !!!
    .
    !
    .....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |