Categories
SQL Server

Searching your stored procedures in SQL Server 2000

SQL Server enables you – in its infinite kindness – to extract all its stored procedure code into one big file, or into one file per stored procedure.
This is very useful if you need to search the stored procedure for a column you modified or want to take a snapshot for a backup.
To do this:

  • right-click the database in which the stored procedures exist and choose ‘All Tasks’.
  • From the popup menu, choose ‘Generate SQL Script’.
  • A window will pop up. Click on the ‘Show All’ button. You will now see all the objects in the database.
  • Select the stored procedure check box (or any other part of the code)
  • From the ‘Options’ tab, select whether you want one big file or separate files for each stored procedure
  • Back in the ‘General’ tab, click OK
  • Select where to store the file(s)
  • Click ok
Share
Categories
Java

JDBC: Finding a ResultSet column was null

Supposed you just executed a database call using JDBC and the results were stored in a ResultSet object called rs. Then, you would expect the following to work if you test whether you returned a null value:


if (rs.getString("field") == null) {
// do something
}

You would be wrong.
Instead, JDBC offers the oh so intuitive wasNull() method:

String val = rs.getString("field");
if (rs.wasNull())
{
// do something
}

The logic behind this is that the ResultSet object is not pre-fetched and hence we can not test for its value before JDBC actually retrieved the value. Am I right?…

This is based on a posting to the SQL Server 2000 JDBC newsgroup.

Share
Categories
Computing Java

Running the Apache James Mail Server as a Windows Service

To make the Apache James mail server into a service on your Windows machine, follow these instructions (shamelessly copied from here)

From a command prompt change directory to the bin folder located under the James installation directory. From the bin folder enter the following command

Wrapper.exe -i ..\conf\wrapper.conf

This will install the James NT service. You can then control this like another service from the Windows Services screen.

To remove the James service use this command

Wrapper.exe -r ..\conf\wrapper.conf

Share
Share