Can any on Explain

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import oracle.jdbc.pool.OracleDataSource;

public class ConnectionThread extends Thread {

private OracleDataSource_dataSource;

private int_cycles;

public ConnectionThread(OracleDataSource dataSource, int cycles) {

super("ConnectionThread" + cycles);

_dataSource= dataSource;

_cycles= cycles;

}

Dear ALL,

this is a piece of code that request a connection to a datasource

what i need is why we call here the super method and what is the two parameters that passed in the super method.

Thanks

[676 byte] By [Husama] at [2007-11-27 10:42:31]
# 1

There is only parameter being passed to the super constructor. You can find out what this is yourself by looking at the API Javadocs for Thread.

Regardless this code is wrong. You should be implementing Runnable and not extending Thread.

cotton.ma at 2007-7-28 19:18:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

It's not wrong. It is just a better design to implement Runnable rather than extend Thread.

And for the first post, I really had no idea what you mean by two parameters to the super constructor. It's a Thread, go look at the API.

kmangolda at 2007-7-28 19:18:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...