SQL2Diagram   November 18th, 2007

SQL2Diagram: A sourceforge project that I am involved in; we use that program at work to keep track of our database structure, consisting of 250+ tables in several modules.

It basically parses the SQL Create Table statements and generates both HTML documentation and diagrams in XML format that can be displayed with the program Dia.

February 2005

look at the page PL Java Website.
change the file C:\Program Files\PostgreSQL\8.0\data\postgresql.conf:

dynamic_library_path = '$libdir;C:/Program Files/PostgreSQL/8.0/pljava'
custom_variable_classes = 'pljava'
pljava.classpath = 'C:/Program Files/PostgreSQL/8.0/pljava/pljava.jar'

Set the classpath:

set CLASSPATH=%CLASSPATH%;deploy.jar;..\jdbc\postgresql-8.0.309.jdbc2.jar;pljava.jar

change into directory “Program Files\PostgreSQL\8.0\pljava” and execute

java org.postgresql.pljava.deploy.Deployer -install -database mydatabase -user somesuperuser -password mypasswd

I got the error:

java.sql.SQLException: ERROR: could not load library "C:/Programme/PostgreSQL/8.0/lib/libpljava.dll": dynamic load error

This page helped me a lot: Debugging PostgreSQL.

runas /user:postgres cmd.exe
postmaster -d 5 -D ../data/

I started postmaster in one command line box, and then psql in another DOS box. That told me that jvm.dll could not be found. Finally I realised, that the path needs to be set before the postmaster is started.

Reports with Symfony   November 17th, 2007

I wondered what the easiest way was to create reports.
I looked into PM Report 4.1 by Zeke Walker, but did not think it would be what I needed.

So this is what I did:
edit the Peer class of your table, and add a function that will return the data that you will need in the report:
lib/model/MyTablePeer.php

static function getAllRowsWithBlabla()
{
$con = Propel::getConnection(self::DATABASE_NAME);
$sql = 'SELECT * FROM '.self::TABLE_NAME.' WHERE a=1 ORDER BY nachname, vorname';
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
return BasePatePeer::populateObjects($rs);
}

Then in apps/myapp/modules/mytable/actions/actions.class.php add an action for the report:

public function executeReportVereinsmitglieder()
{
$this->items = MyTablePeer::getAllRowsWithBlabla();
}

Finally, create a success page:
apps/myapp/modules/mytable/templates/reportBlablaSuccess.php



Date created:




My blabla report







if ($item->getSomeCondition())
{
if ($first)
{
$first = false;
}
else
{
echo ', ';
}
echo $item->getMyValue();
}

?>

To disable some items for printing, I changed the css styles
in file apps/myapp/templates/layout.php: