SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 89 | Next

Deepak Vohra

"Ajax in Oracle JDeveloper"

Copy UserRegistration.java, which is listed below, to the
JDeveloper project.
package dwr;
import java.sql.*;
import javax.naming.InitialContext;
public class UserRegistration {
public UserRegistration() {
}
public boolean validate(String userId) {
boolean valid=true;
try {
InitialContext initialContext =
new InitialContext();
javax.sql.DataSource ds =
(javax.sql.DataSource)initialContext.lookup
(???java:MySqlDS???);
java.sql.Connection conn
= ds.getConnection();
// Obtain result set
Statement stmt = conn.createStatement();
String query =
???SELECT * from UserTable WHERE userId=???
+ ?????™??? + userId +
?????™???;
ResultSet rs = stmt.executeQuery(query);
if (rs.next()) {
valid = false;
return valid;
}
conn.close();
} catch (SQLException e) {
System.out.println(e.getMessage());
5.3 Creating a DWR Application 99
} catch (javax.naming.NamingException e) {
System.out.println(e.getMessage());
}
return valid;
}
public String updateUserTable(String userId,
String password) {
try {
InitialContext initialContext =
new InitialContext();
javax.sql.DataSource ds =
(javax.sql.DataSource)initialContext.lookup
(???java:MySqlDS???);
java.sql.Connection conn =
ds.getConnection();
Statement stmt = conn.createStatement();
String sql =
???INSERT INTO UserTable VALUES(??? + ???\??™??? +
userId + ???\??™??? + ???,??? +
???\??™??? + password + ???\??™??? + ???)???;
stmt.


Pages:
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6