Results 1 to 3 of 3

Thread: DB2 <-> JdbcTeamplete queryForObject Performance

  1. #1
    Join Date
    Aug 2007
    Posts
    2

    Default DB2 <-> JdbcTeamplete queryForObject Performance

    Hi, Currently i facing a perfomance problem,
    i did a login access which access to db2 to retrive the user data according to chapter 11 of spring tutorial, but the Return is kind of slow, i dun know wat happen, any 1 can help me?

    Belowis the log File:
    Code:
    2007-08-17 09:58:33,926 INFO [login.LoginDaoJdbc] - Before
    2007-08-17 09:58:33,942 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing SQL query [select WUSER_ID, USER_LOGIN, USER_NAME, NRIC, WACCESS_GROUP, CREATED_BY, DATE_CREATED, PASSWORD, IS_LOGIN, LAST_LOGIN, ALLOW_DEL, IS_PASSWORD_CHANGE,STATUS_ID, ALLOW_DEL, IS_LOCK from PTB.TBL_WUSER where USER_LOGIN=? and PASSWORD=?]
    2007-08-17 09:58:33,942 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC Connection from DataSource
    2007-08-17 09:58:33,942 DEBUG [org.springframework.jdbc.datasource.DriverManagerDataSource] - Creating new JDBC Connection to [jdbc:odbc:FNAIMS]
    2007-08-17 10:00:08,842 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 1, parameter value [admin], value class [java.lang.String], SQL type unknown
    2007-08-17 10:00:09,358 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 2, parameter value [admin], value class [java.lang.String], SQL type unknown
    2007-08-17 10:00:23,853 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
    2007-08-17 10:00:43,353 INFO [login.LoginDaoJdbc] - After
    As You Can see, there is around 2min to get the result Set.

    My Query Code:

    Code:
     public Object getUser(String user_login, String password) {
            log.info(user_login + " " + password);
            JdbcTemplate jt = new JdbcTemplate(ds);
            
            log.info("Before");
            User user= (User) jt.queryForObject(
                    "select * from User where LOGIN=? and PASSWORD=?",
                    new Object[] {user_login, password}, new RowMapper(){
                
                public Object mapRow(ResultSet rs, int rowNum) throws SQLException{
                    
                    /* setter method here */
    
                }
    
            });
            log.info("After");
            return user;
        }
    My Machinse is penium4 2.8 ghz with 1 g of ram.
    I am using netBeans and run db2 locally.
    Last edited by xlancer; 08-17-2007 at 02:16 AM.

  2. #2
    Mark Pollack is offline Spring.NET Co-Lead Spring TeamSpring User
    Join Date
    Sep 2004
    Location
    New York, NY
    Posts
    1,683

    Default

    Hi,

    You should post your question to the Spring Java forums, this is forum is for the .NET version. Maybe it takes a long time because you are retrieving a great amount of data? Just a quick guess.

    Cheers,
    Mark

  3. #3
    Join Date
    Aug 2007
    Posts
    2

    Default

    oops!!

    i tot this is for wat ever spring....

    thanks man.

    i solve the problem by changing to remote server environment.

    i only have 1 dummy record in db but still consume a lot memory :???:

    db2 really

Posting Permissions

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