Tuesday, March 29, 2005

Finish Registeration With chekcing in both UserInfo and admin table

07:50

Solve the problem:

resultSet rs = executeQuery(strSQL1);

rs.next(); /// very important!

String here = rs.getString;


15.00

can resolve the problem as it seems that the control the resultSet, the rs method.

I found that the return of rs are not the null value but a string, namely

com.microsoft.jdbc.base.BaseResultSet@49cf9f


18.30

check user name L used


"SELECT count(*) AS count FROM member_info WHERE login_id = '" + name +"'";


ResultSet rs = ......


re.next();

if (result.getInt("count") == 0)

{

LHO user name

}

else

{

H

}

_ (06:43 PM) :

Y{ ...

count {..

(06:43 PM) :

count(*);


select * from ....


rs.last() <---- result set pointer h@ record

int numOfRow = re.getRow() <---- get a pointer b@


if ( numOfRow == 0)

{LH}

else

{H}


try {

// Step 2: load the SQL server 2000 JDBC driver

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


// Step 3: estalish the connection to the database

con = DriverManager.getConnection(url, dbLoginId, dbPwd);

System.out.println("6");


// disable auto commit;

System.out.println("7");

//Step 4: Create a statement

stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

//Step 4.1: after execute ceateStatement

System.out.println("8");


// First, find if the userID has already exits

strSQL3 = "select * from UserInfo where user_name='"+strUserName+"'";

System.out.println(strUserName);

System.out.println("9");

//boolean isExist = false;

System.out.println("9.1");

strSQL4 = "SELECT u_id FROM UserInfo WHERE user_name='"+strUserName+"'";

rs = stmt.executeQuery(strSQL3);

System.out.println("9.1.1");

System.out.println(rs.toString());

rs.next();

System.out.println(rs.toString());

//String tempStore = null;

System.out.println("9.1.2");

// go to the last record

rs.last();

// If the record exist, get hterow number, ie, record

int getNumberOfRow = rs.getRow();

if (getNumberOfRow != 0){

System.out.println("Same User Name has been registered. ");

System.out.println("9.3");

boolReg = false;

}


20.30

Finish the registration. Now i am working on the buy/sell sections.


Jakarta Tomcat - QueryRunner

http://jakarta.apache.org/commons/dbutils/apidocs/org/apache/commons/dbutils/QueryRunner.html


290305

00.19

Now we are undergoing the phase II, well, cathy work on admin page and I working on the buying/selling section

the administrator page divided into two pages: display normal user information and display terminated user informations.


01.10

response.sendRedirect("/iad/mainServlet");


01.42

Remember, in the registration page, we should check the user_name should not the saem as the administrators.


11.30

Successfully update the registration processes

0 Comments:

Post a Comment

<< Home