Sander Klooster

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

Recent posts by Sander Klooster

Fawcette
this link contains a nice struts example.
Sander.
20 years ago
Hi,
I'm trying to run an application therefore I need to run a script to install it (startup.sh) from a QSHELL. Since I'm using a pc (and not an OS/as400 enviroment) no qshell interpreter is installed. So is it possible to run such scripts with WAS 5.0 and how do I manage this. I've tried to figure it out by the help manual but this drives me .....
Tnx.
20 years ago
Hi Diego,Marilyn,
Of course I've read the instuctions and I do inderstand by charging for the course you get serious students. But I believe charging about 200 euro's is a lot of money, I rather spend the money for the SCPD exam (in the Netherlands a SCPD makes more sence than a sheriff!)
Nevertheless, I'll continue working on the assignments because I'm (still)a java greenhorn and they are a good practice!
By the way, JavaRanch is absolutely number 1. This site is a great (or maybe the best) help.
Regards,
Sander.
20 years ago
Hi,
why do you have to pay for joining The Cattle Drive?
20 years ago
Hi Kyle,
That works!
tnx a lot
Sander.
20 years ago
hi,
You can try this code to make a connection.
first make a class ConnectionManager, like this:
package dbMySql;
import java.sql.Connection;
import java.sql.DriverManager;
/**
* Sander Klooster
* This class provides access to the MYSQL database.
*/
public class ConnectionManager
{
static
{
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
} catch (Exception e)
{
e.printStackTrace(System.out);
}
}
public static Connection getConnection()
{
try
{
return DriverManager.getConnection("jdbc:mysql://localhost/sir?user=multi&password=media");
} catch (Exception e)
{
e.printStackTrace(System.out);
throw new Error("Could not resolve database connection.");
}
}
}

Then another class BusinessObject, like this:
package dbMySql;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import dbMySql.ConnectionManager;
/**
* Sander klooster.
* This class is the base class for all business objects.
*/
public abstract class BusinessObject {
abstract protected void unpackResultSet(ResultSet rs)
throws java.sql.SQLException;
/**
* This method retreives data from the database. It uses the query
* to make a ResultSet. This ResultSet is passed to the retreiveResultSet
* method which is declared in this class.
*/
protected boolean retrieveData(String query) {
try {
Connection connection = ConnectionManager.getConnection();
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query);
if (!resultSet.next()) {
resultSet.close();
statement.close();
connection.close();
return false; // no rows in result set
} else {
unpackResultSet(resultSet);
resultSet.close();
statement.close();
connection.close();
return true;
}
} catch (Exception e) {
e.printStackTrace(java.lang.System.out);
throw new Error("Database error.");
}
}
}
You have to modify the DataBase class of course..
good luck.
20 years ago
Hello,
How do I run a class which receives run-time parameters by the main() method. I'm using WSAD 5.
20 years ago
Option 4 is the correct one.
Hi, you can try the following: Restore From Local History... (from right-click at project/package folder)
As soon as you create a project, WSAD starts creating (project) folders in workspace. So removing the project from workspace will solve the problem. It's also not a bad idea to clear up the workspace by changing the workspace directory, and then removing the entire older workspace folder.
maybe because the "new" users are waiting at home for a job and therefore have plenty of time to visit the ranch. (Like myself).
20 years ago

Originally posted by Sander Klooster:
Hello, I'm looking for a tutorial which describes building web apps. with Struts. I'm using WSAD 5.0.1.
Tnx alot.


Cindy, Thomas
thanks a lot!
Sander.
20 years ago
Hello, I'm looking for a tutorial which describes building web apps. with Struts. I'm using WSAD 5.0.1.
Tnx alot.
20 years ago