Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Jyothi Lature

Ranch Hand
+ Follow
since Oct 31, 2001
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jyothi Lature

This is an excellent work!!!

Thanks so much for sharing your work. It has really helped in remembering about listener methods in a better way.

Thanx again.

Its a good practise to create a database connection in the init() method. The init() allows us to specify the DB URL, userid/password in the deployment descriptor(i.e., web.xml file). The servlet can get the values from the deployment descriptor at the time of initializing. We can avoid hardcoding these values in the servlet file. The values in the deployment descriptor can be changed as needed without affecting the servlet code. The servlet container initializes the servlet only once by calling the init().

By having the code of creating dbconnection in the service(), the connection object will be created for every request as service() gets called for every request recieved from the browser. Thus this will turn out to be very expensive and the performance will go down. This is a bad practise of coding.
19 years ago

I would strongly suggest you to use Connection pooling. Registering a driver, connecting to the database for every transacation is a very bad practice of coding. Creating new database connections is an expensive operation. The optimal technique is to make sure that database connections opened in one request are reused in subsequent requests.
Creating a statement object and ResultSet object and then closing them after every transaction is a must.

To know more about Connection pool and for example code, refer to this link:
Connection Pooling

Hope this is useful..
Do you mean thay will use japanese/chinese language characters (or alphabets) while entering username/password???
19 years ago
Apache Tomcat 4.0 and j2sdk1.4 should be sufficient.
19 years ago
Hi John,

The button update in your servlet page is already of SUBMIT type, which means action will be executed automatically when you click on the upadte button. You dont have to explicitly call theForm.submit(); again. This will cause the form to submit it second time. So, comment the line -- [B]theForm.submit();{/B]. This should correct your code.
19 years ago

If the problem is finding in javac compiler, then SET you PATH to jdk_dir/bin folder.
19 years ago

This looks pretty simple!!!

When you get the first row from ResultSet object by doing and compare the value of svcvol == 0, then print the statement to be displayed.

For ex:
if (
int count = rs.getInt(1);
if(count == 0)
System.out.println("NO RESULT FOUND................");


I dont know if this is what you wanted.
Hi, --- is a cool link... Thanks for sharing the info.
This link answers the question.

Check the format of the date field and insert the DOB value in the same format. You can change format of the Date variable using SimpleDateFormat class in java.

Its bcoz, it has value like "1234 which is not in NUMERIC format.
Try changing the datatype to VARCHAR(5), it should allow you to do...

JDBC IS Java Database Connectivity, standardized DB interface for Java. This technology allows to write applications and use it with any SQL database that has a JDBC-driver.
So, i dont think it can be anything else....!
Try creating a synonym on the object and granting insert right to it...

Hope you have set the classpath pointing to the jar file/zip file containing this (com.pointbase.jdbc.jdbcUniversalDriver) driver class.

Try setting the classpath... it will work!!!

If the question is regarding SQLServer 2000 database particularly, then i think this is a wrong place to post this question. If it is regarding JDBC, then the solution would be to use ResultSetMetaData Interface.
The sample code to get the column Data type would be:

ResultSet rs = st.executeQuery("Select * from student");

ResultSetMetaData rsmd = rs.getMetaData();
String col_dtype = rsmd.getColumnTypeName(1);

Variable col_dtype will have the column data type for the first column of student table.
Similarly, you can put the last line in a loop to get the column datatype for all columns.