Monday, November 26, 2007

MySQL skeleton political database installed


Today I placed a facility on my experimental site billboushka.com to look at entries in my "Political Knowledge" database. This is on a shared web hosting site on a Unix platform with MySQL.

Right now, it is very rudimentary with only a few records. The link to the facility and instructions are here. The login ID supplied allows SELECT only. Note that the bookmark facility does not yet work. That require certain tables in phpmyadmin.pma_bookmark and I am trying to find an easy way to create them.

Some typical queries are

SELECT `argtb` . * FROM argtb LIMIT 0, 30 ;

SELECT `incident` . * FROM incident LIMIT 0, 30 ;

SELECT `argtb` . `srcecode` , `argtb` . `stateargument` , `incident` . `srcecode` FROM argtb , incident WHERE `argtb` . `srcecode` = `incident` . `srcecode` ORDER BY `argtb` . `srcecode` ASC , `argtb` . `stateargument` ASC , `incident` . `srcecode` ASC LIMIT 0, 30 ;

At one time, I had a service on another ISP that offered java, but it became unreliable. The java you could code a .jsp element like this:

It looked like this:

response.setContentType("text/html");

Class.forName("org.gjt.mm.mysql.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://mysql.xxxxxx.com/topics", "jboushka", "xxxxx");


Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT topic.topicdesc, topic.argcd, topic.polcode, topic.polkind, topic.actdate, topic.actionds, argument.argtext FROM topic, argument where topic.argcd = argument.argcd");


while(rs.next()) {
out.print("");
out.println("" + rs.getString("topicdesc") + "" + "" + rs.getString("argcd")+ "" + "" + rs.getString("polcode") + "" + "" + rs.getString("polkind") + " " + "" + rs.getString("actdate") + "" + "" + rs.getString("actionds") + "" + "" + rs.getString("argtext") + "");
out.print("");
}


I've considered doing this with Visual Studio .NET and C#, but I would have to purchase Microsoft Professional Edition of Visual Studio (as discussed on this blog in August).

No comments: