initial commit #2

Esse commit está contido em:
Florian Jenett
2010-03-30 19:01:42 +02:00
commit 8224dc3b2a
23 arquivos alterados com 2395 adições e 0 exclusões
+22
Ver Arquivo
@@ -0,0 +1,22 @@
# Mac fun
.DS_Store
# ant-javac build directory
bin/
# hide some results
documentation/*
distribution/*
# XCode
build/
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
# old stuff i can't seem to be able to delete
hidden/
releases/
Arquivo executável
+33
Ver Arquivo
@@ -0,0 +1,33 @@
--------------------------------------------------------------------------------
SQLibrary, a Processing library that wraps around JDBC drivers to let
you access MySQL, SQLite and PostgreSQL databases
--------------------------------------------------------------------------------
Need to write something usefull here ...
--------------------------------------------------------------------------------
Parts of this library are available under their own licenses. These are
redistributed as downloaded from the original sources:
MySQL Connector/J (JDBC driver)
mysql-connector-java-3.1.8-bin.jar
http://dev.mysql.com/downloads/connector/j/
http://dev.mysql.com/downloads/connector/j/3.1.html
GPL, http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
PostgreSQL JDBC driver
postgresql-8.3-604.jdbc3.jar
http://jdbc.postgresql.org/
http://jdbc.postgresql.org/download.html
BSD, http://jdbc.postgresql.org/license.html
SQLite JDBC driver
sqlitejdbc-v036-nested.jar
sqlitejdbc-v053-pure.jar
http://www.zentus.com/sqlitejdbc/
BSD, http://www.zentus.com/sqlitejdbc/license.html
--------------------------------------------------------------------------------
+270
Ver Arquivo
@@ -0,0 +1,270 @@
<project name="SQLibrary" default="build" basedir="./">
<description>
SQLibrary build file, based on Processing
libraries build file.
</description>
<target name="settings">
<!-- #### (1) who is the author of this library? edit value. #### -->
<property name="author" value="Florian Jenett"/>
<!-- #### (2) which copyright? edit value. #### -->
<property name="copyright" value="(c) 2005 - 2009"/>
<!-- #### (3) give your library a name. edit value. #### -->
<property name="libraryName" value="SQLibrary"/>
<!-- #### (4) give your library a name. edit value. #### -->
<property name="versionNumber" value="0.1.0"/>
<!-- #### (5) your contact url. edit value. #### -->
<property name="yourLink" value="http://bezier.de/" />
<property name="keywords" value="MySQL, SQLite, PostgreSQL, SQL, database"/>
<!-- #### (5) where are your processing libraries located? edit location. #### -->
<property name="processing" location="/Users/fjenett/Documents/Processing/libraries"/>
<!-- #### (6) set the java version that should be used to compile your library. #### -->
<property name="javaVersion" value="1.5"/>
<!-- #### (7) where are the jar files located that are required for compiling
your library such as e.g. core.jar ? edit location.
#### -->
<property name="libraryClasspath" location="/Applications/Processing.app/Contents/Resources/Java/"/>
<path id="library-classes-add">
<fileset dir="lib">
<include name="mysql-connector-java-3.1.14-bin.jar"/> <!-- MySQL -->
<include name="sqlitejdbc-v053-pure.jar"/> <!-- SQLite -->
<include name="postgresql-8.3-604.jdbc3.jar"/> <!-- PostgreSQL -->
</fileset>
</path>
<path id="library-classpath">
<fileset dir="${libraryClasspath}" >
<!-- #### (8) add the jar files that are required for compiling. edit name.
for more include files. duplicate <include name="" />
#### -->
<include name="core.jar"/>
</fileset>
<path refid="library-classes-add" />
</path>
<!-- no changes or adjustments required below -->
<property name="jarFile" value="${libraryName}.jar"/>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="javadoc" location="documentation"/>
<property name="dist" location="distribution"/>
<property name="build" location="build"/>
</target>
<target name="init" depends="settings">
<echo>Properties initialized.
src path ${src}
bin path ${bin}
libraryClasspath ${libraryClasspath}
processing Libraries ${processing}
java version ${javaVersion}
</echo>
<buildnumber file="lib/build.number"/>
<tstamp> <!-- Create the time stamp -->
<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour"/>
</tstamp>
<echo>Start to build the library ... this is vers. ${versionNumber}, build #${build.number} on ${date}</echo>
<!--
add ant-contrib package, needed for <foreach>
-->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<mkdir dir="${dist}"/>
</target>
<!--echo>${toString:library-classpath}</echo-->
<!-- compile the library -->
<target name="compile" depends="init" description="compile the source" >
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" source="${javaVersion}">
<classpath>
<path refid="library-classpath"/>
</classpath>
</javac>
</target>
<!-- build the distribution of the library -->
<target name="build" depends="compile" description="generate the distribution" >
<!-- delete the previous content of the ${dist} folder -->
<delete dir="${dist}" />
<!-- build the structure for ${dist} -->
<mkdir dir="${dist}" />
<mkdir dir="${dist}/library" />
<mkdir dir="${dist}/examples" />
<mkdir dir="${dist}/documentation" />
<mkdir dir="${dist}/source" />
<jar jarfile="${dist}/library/${jarFile}" basedir="${bin}"/>
<copy todir="${dist}/examples">
<fileset dir="examples"/>
</copy>
<copy todir="${dist}/source">
<fileset dir="${src}" />
</copy>
<copy todir="${dist}/library">
<path refid="library-classes-add" />
</copy>
<!-- create the java documentation of the library -->
<mkdir dir="${javadoc}" />
<javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}"
destdir="${javadoc}"
verbose="false"
stylesheetfile="resources/stylesheet.css"
doctitle="Javadocs: ${libraryName}"
public="true" version="false"
windowtitle="Javadocs: ${libraryName}">
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*"/>
</fileset>
<classpath>
<path refid="library-classpath"/>
</classpath>
</javadoc>
<copy todir="${dist}/documentation">
<fileset dir="${javadoc}" />
</copy>
<!-- copy the jar file to processing's libraries -->
<mkdir dir="${processing}/${libraryName}" />
<copy todir="${processing}/${libraryName}">
<fileset dir="${dist}"/>
</copy>
<!-- zip the distribution of the library -->
<zip destfile="${dist}/${libraryName}-${versionNumber}.zip"
basedir="${dist}"
excludes="**/_DS.Store"
/>
<!-- <rename src="${dist}/${libraryName}.zip" dest="${dist}/${libraryName}_${versionNumber}.zip" /> -->
<!-- organize the ${dist} folder -->
<mkdir dir="${dist}/web" />
<move todir="${dist}/web/documentation">
<fileset dir="${dist}/documentation" />
</move>
<move todir="${dist}/web/examples">
<fileset dir="${dist}/examples" />
</move>
<delete dir="${dist}/library" />
<copy todir="${dist}/web">
<fileset dir="web" />
</copy>
<!--
format the index.html file.
regular expressions are used to parse the web index.html file.
key words starting and ending with ## are replaced by values
defined earlier in the beginning of this build file.
-->
<replaceregexp file="${dist}/web/index.html"
match="##yourLibrary##"
replace="${libraryName}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##author##"
replace="${author}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##versionNumber##"
replace="${versionNumber}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##yourLink##"
replace="${yourLink}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##date##"
replace="${date}"
flags="g" />
<replaceregexp file="${dist}/web/index.html"
match="##keywords##"
replace="${keywords}"
flags="g" />
<antcall target="processExamples" />
<!-- finish organizating library's distribution -->
<mkdir dir="${dist}/web/download" />
<copy file="${dist}/${libraryName}-${versionNumber}.zip" todir="${dist}/web/download" />
<copy todir="${processing}/${libraryName}/documentation">
<fileset dir="${javadoc}" />
</copy>
<!-- done, finished. -->
</target>
<!-- XCode clean target task -->
<target name="clean" >
<delete dir="${dist}" />
<delete dir="${javadoc}" />
<delete dir="${build}" />
</target>
<!-- parsing the examples folder -->
<target name="processExamples">
<dirset id="examples.contents" dir="examples" excludes="*/*"/>
<property name="examples.list" refid="examples.contents"/>
<foreach list="${examples.list}" target="addExamples" param="exampleDir" delimiter=";">
</foreach>
<!--echo>${examples.list}</echo-->
<!--foreach param="exampleDir" target="addExamples">
<path>
<dirset id="examples.contents" dir="examples" excludes="*/*"/>
</path>
</foreach-->
<replaceregexp file="${dist}/web/index.html"
match="(##examples##)"
replace=""
flags="g" />
</target>
<target name="addExamples" depends="settings">
<property name="exampleZipped" value="${exampleDir}.zip"/>
<zip destfile="${dist}/web/examples/${exampleZipped}"
basedir="${dist}/web/examples/${exampleDir}/"
excludes="**/_DS.Store" />
<replaceregexp file="${dist}/web/index.html"
match="(##examples##)"
replace="&lt;li&gt;&lt;a href=&quot;examples/${exampleZipped}&quot;&gt;${exampleDir}&lt;/a&gt;&lt;/li&gt; \1"
flags="g" />
</target>
</project>
+49
Ver Arquivo
@@ -0,0 +1,49 @@
import de.bezier.data.sql.*;
// created 2005-05-10 by fjenett
// updated fjenett 20081129
MySQL msql;
void setup()
{
size( 100, 100 );
// this example assumes that you are running the
// mysql server locally (on "localhost").
//
// replace --username--, --password-- with your mysql-account.
//
String user = "root";
String pass = "admin";
// name of the database to use
//
String database = "bildwelt";
// add additional parameters like this:
// bildwelt?useUnicode=true&characterEncoding=UTF-8
// connect to database of server "localhost"
//
msql = new MySQL( this, "localhost", database, user, pass );
if ( msql.connect() )
{
msql.query( "SELECT COUNT(*) FROM image" );
msql.next();
println( "number of rows: " + msql.getInt(1) );
}
else
{
// connection failed !
}
}
void draw()
{
// i know this is not really a visual sketch ...
}
+57
Ver Arquivo
@@ -0,0 +1,57 @@
import de.bezier.data.sql.*;
// created 2005-05-10 by fjenett
// updated fjenett 20080605
MySQL dbconnection;
void setup()
{
size( 100, 100 );
// this example assumes that you are running the
// mysql server locally (on "localhost").
//
// replace --username--, --password-- with your mysql-account.
//
String user = "ffu";
String pass = "ffu";
// name of the database to use
//
String database = "ffu";
// name of the table that will be created
//
String table = "";
// connect to database of server "localhost"
//
dbconnection = new MySQL( this, "localhost", database, user, pass );
if ( dbconnection.connect() )
{
// now read it back out
//
dbconnection.query( "SELECT * FROM file_uploads" );
while (dbconnection.next())
{
String s = dbconnection.getString("name");
int n = dbconnection.getInt("fuid");
println(s + " " + n);
}
}
else
{
// connection failed !
}
}
void draw()
{
// i know this is not really a visual sketch ...
}
+41
Ver Arquivo
@@ -0,0 +1,41 @@
import de.bezier.data.sql.*;
/*
CREATE TABLE `test` (
`id` int(10) NOT NULL auto_increment,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
*/
MySQL ms;
java.sql.Timestamp last_ts;
String database = "ddd", user = "", pass = "";
void setup ()
{
ms = new MySQL( this, "localhost", database, user, pass );
last_ts = new java.sql.Timestamp( 0 );
if ( ms.connect() )
{
ms.query( "SELECT * FROM test ORDER BY time ASC LIMIT 1" );
ms.next();
last_ts = ms.getTimestamp("time");
}
}
void draw ()
{
if ( ms.connect() )
{
ms.query( "SELECT * FROM test WHERE time > '"+last_ts+"' ORDER BY time ASC" );
while( ms.next() )
{
println( ms.getInt( "id" ) );
last_ts = ms.getTimestamp( "time" );
}
}
}
@@ -0,0 +1,57 @@
// updated fjenett 20081129
import de.bezier.data.sql.*;
PostgreSQL pgsql;
void setup()
{
size( 100, 100 );
// this example assumes that you are running the
// postgresql server locally (on "localhost").
//
// replace with your own postgresql-account.
//
String user = "fjenett";
String pass = "fjenett";
// name of the database to use
//
String database = "test";
// connect to database on "localhost"
//
pgsql = new PostgreSQL( this, "localhost", database, user, pass );
// connected?
if ( pgsql.connect() )
{
// query the number of entries in table "weather"
pgsql.query( "SELECT COUNT(*) FROM weather" );
// results found?
if ( pgsql.next() )
{
// nice, then let's report them back
println( "number of rows in table weather: " + pgsql.getInt(1) );
}
// now let's query for last 10 entries in "weather"
pgsql.query( "SELECT * FROM weather LIMIT 10" );
// anything found?
while( pgsql.next() )
{
// splendid, here's what we've found ..
println( pgsql.getString("city") );
}
}
else
{
// yay, connection failed !
}
}
+33
Ver Arquivo
@@ -0,0 +1,33 @@
// fjenett 20081129
import de.bezier.data.sql.*;
SQLite db;
void setup()
{
size( 100, 100 );
db = new SQLite( this, "test.db" ); // open database file
if ( db.connect() )
{
// list table names
db.query( "SELECT name as \"Name\" FROM SQLITE_MASTER where type=\"table\"" );
while (db.next())
{
println( db.getString("Name") );
}
// read all in table "table_one"
db.query( "SELECT * FROM table_one" );
while (db.next())
{
println( db.getString("field_one") );
println( db.getInt("field_two") );
}
}
}
Arquivo binário não exibido.
Arquivo binário não exibido.
+3
Ver Arquivo
@@ -0,0 +1,3 @@
#Build Number for ANT. Do not edit!
#Tue Mar 30 10:06:53 CEST 2010
build.number=302
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
+269
Ver Arquivo
@@ -0,0 +1,269 @@
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* processingLibs style by andreas schlegel, sojamo */
body {
margin : 0;
padding : 0;
padding-left : 10px;
padding-right : 8px;
background-color : #FFFFFF;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size : 100%;
font-size : 0.7em;
font-weight : normal;
line-height : normal;
margin-bottom:30px;
}
/* Headings */
h1, h2, h3, h4, h5, th {
font-family :Arial, Helvetica, sans-serif;
font-size:1.2em;
}
p {
font-size : 1em;
width:80%;
}
pre, code {
font-family : "Courier New", Courier, monospace;
font-size : 12px;
line-height : normal;
}
table {
border:0;
margin-bottom:10px;
margin-top:10px;
}
tr, td {
border-top: 0px solid;
border-left: 0px solid;
padding-top:8px;
padding-bottom:8px;
}
hr {
border:0;
height:1px;
padding:0;
margin:0;
}
dd, th, td, font {
font-size:1.0em;
line-height:1.0em;
}
dt {
margin-bottom:4px;
}
dd {
margin-bottom:20px;
}
a {
text-decoration: underline;
font-weight: normal;
}
a:hover,
a:active {
text-decoration: underline;
font-weight: normal;
}
a:visited,
a:link:visited {
text-decoration: underline;
font-weight: normal;
}
img {
border: 0px solid #000000;
}
/* Navigation bar fonts */
.NavBarCell1 {
border:0;
}
.NavBarCell1Rev {
border:0;
}
.NavBarFont1 {
font-family: Arial, Helvetica, sans-serif;
font-size:1.1em;
}
.NavBarFont1 b {
font-weight:normal;
}
.NavBarFont1:after, .NavBarFont1Rev:after {
font-weight:normal;
content: " \\";
}
.NavBarFont1Rev {
font-family: Arial, Helvetica, sans-serif;
font-size:1.1em;
}
.NavBarFont1Rev b {
font-family: Arial, Helvetica, sans-serif;
font-size:1.1em;
font-weight:normal;
}
.NavBarCell2 {
font-family: Arial, Helvetica, sans-serif;
}
.NavBarCell3 {
font-family: Arial, Helvetica, sans-serif;
}
font.FrameItemFont {
font-family: Helvetica, Arial, sans-serif;
}
font.FrameHeadingFont {
font-family: Helvetica, Arial, sans-serif;
line-height:32px;
}
/* Font used in left-hand frame lists */
.FrameTitleFont {
font-family: Helvetica, Arial, sans-serif
}
/* COLORS */
pre, code {
color: #000000;
}
body {
color : #333333;
background-color :#FFFFFF;
}
h1, h2, h3, h4, h5, h6 {
color:#5A5A46;
}
a {
color: #3399CC;
}
a:hover,
a:active {
color: #3399CC;
}
a:visited,
a:link:visited {
color: #3399CC;
}
td,tr {
border-color: #999999;
}
hr {
color:#999999;
background:#999999;
}
.TableHeadingColor {
background: #CCCCBE;
color: #5A5A46;
}
.TableSubHeadingColor {
background: #EEEEFF
}
.TableRowColor {
background: #FFFFFF
}
.NavBarCell1 {
background-color:#CCCCBE;
color:#000;
}
.NavBarCell1 a {
color:#5A5A46;
}
.NavBarCell1Rev {
background-color:transparent;
}
.NavBarFont1 {
color:#5A5A46;
}
.NavBarFont1Rev {
color:#fff;
}
.NavBarCell2 {
background-color:#999983;
}
.NavBarCell2 a {
color:#fff;
}
.NavBarCell3 {
background-color:#DCDCC3;
}
+129
Ver Arquivo
@@ -0,0 +1,129 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {
/* Begin PBXFileReference section */
0A8B99810B8F55E2003CD01B /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = lib; sourceTree = "<group>"; };
0A8B99840B8F55E8003CD01B /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = "<group>"; };
0A8B99880B8F55EC003CD01B /* resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = resources; sourceTree = "<group>"; };
0A8B99B20B8F56A4003CD01B /* build.xml */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = build.xml; sourceTree = "<group>"; };
102B02030DF7CBC800494D06 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
102B02040DF7CBC800494D06 /* stylesheet.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = stylesheet.css; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
00E6828FFEC88D1A11DB9C8B = {
isa = PBXGroup;
children = (
102B02020DF7CBC800494D06 /* web */,
0A8B99B20B8F56A4003CD01B /* build.xml */,
0A8B99840B8F55E8003CD01B /* src */,
0A8B99880B8F55EC003CD01B /* resources */,
0A8B99810B8F55E2003CD01B /* lib */,
);
sourceTree = "<group>";
};
102B02020DF7CBC800494D06 /* web */ = {
isa = PBXGroup;
children = (
102B02030DF7CBC800494D06 /* index.html */,
102B02040DF7CBC800494D06 /* stylesheet.css */,
);
path = web;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXLegacyTarget section */
0A8B99D50B8F57BB003CD01B /* sql */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "-emacs $(ACTION)";
buildConfigurationList = 0A8B99E60B8F5847003CD01B /* Build configuration list for PBXLegacyTarget "sql" */;
buildPhases = (
);
buildToolPath = /usr/bin/ant;
dependencies = (
);
name = sql;
passBuildSettingsInEnvironment = 1;
productName = sql;
};
/* End PBXLegacyTarget section */
/* Begin PBXProject section */
00E6828EFEC88D1A11DB9C8B /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 0AE31F6908BBAC2E002AF232 /* Build configuration list for PBXProject "sql" */;
compatibilityVersion = "Xcode 3.0";
hasScannedForEncodings = 1;
mainGroup = 00E6828FFEC88D1A11DB9C8B;
productRefGroup = 00E6828FFEC88D1A11DB9C8B;
projectDirPath = "";
projectRoot = "";
targets = (
0A8B99D50B8F57BB003CD01B /* sql */,
);
};
/* End PBXProject section */
/* Begin XCBuildConfiguration section */
0A8B99E70B8F5847003CD01B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = sql;
};
name = Debug;
};
0A8B99E80B8F5847003CD01B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
PRODUCT_NAME = sql;
};
name = Release;
};
0AE31F6A08BBAC2E002AF232 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
0AE31F6B08BBAC2E002AF232 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
0A8B99E60B8F5847003CD01B /* Build configuration list for PBXLegacyTarget "sql" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0A8B99E70B8F5847003CD01B /* Debug */,
0A8B99E80B8F5847003CD01B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0AE31F6908BBAC2E002AF232 /* Build configuration list for PBXProject "sql" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0AE31F6A08BBAC2E002AF232 /* Debug */,
0AE31F6B08BBAC2E002AF232 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 00E6828EFEC88D1A11DB9C8B /* Project object */;
}
+57
Ver Arquivo
@@ -0,0 +1,57 @@
package de.bezier.data.sql;
import processing.core.*;
/**
* MySQL wrapper for SQL library for Processing 1.0
* <p>
* A wrapper around some of sun's java.sql.* classes
* and the "com.mysql.jdbc.Driver" driver by mysql.com (GPL).
* </p>
* see:
* - http://www.mysql.com/products/connector/j/
* - http://java.sun.com/products/jdbc/
*
*
* @author Florian Jenett - mail@florianjenett.de
*
* created: 07.05.2005 - 12:46 Uhr
* modified: fjenett 20081129
*
* @since 0.0.1
* @version 0.0.7
*
*/
public class MySQL
extends de.bezier.data.sql.SQL
{
public MySQL ( PApplet _papplet, String _database )
{
// should not be used
}
/**
* Creates a new MySQL connection.
*
* @param _papplet Normally you'd pass "this" in for your sketch
* @param _server The server running the database, try "localhost"
* @param _database Name of the database
* @param _user Username for that database
* @param _pass Password for user
*/
public MySQL ( PApplet _papplet, String _server, String _database, String _user, String _pass)
{
super( _papplet, _server, _database, _user, _pass );
init();
}
private void init ()
{
this.driver = "com.mysql.jdbc.Driver";
this.type = "mysql";
this.url = "jdbc:" + type + "://" + server + "/" + database;
}
}
+66
Ver Arquivo
@@ -0,0 +1,66 @@
package de.bezier.data.sql;
import processing.core.*;
/**
* PostgreSQL wrapper for SQL library for Processing 1.0
* <p>
* This is a wrapper around some of sun's java.sql.* classes
* and the "org.postgresql.Driver" driver by postgresql.org (BSD).
* </p>
* see:<ul>
* <li>http://jdbc.postgresql.org/download.html</li>
* <li>http://java.sun.com/products/jdbc/</li>
* </ul>
*
* PostgreSQL on OS-X (i used a mix of these on 10.5.x):<ul>
* <li>http://developer.apple.com/internet/opensource/postgres.html</li>
* <li>http://shifteleven.com/articles/2008/03/21/installing-postgresql-on-leopard-using-macports</li>
* <li>http://systems.takizo.com/2008/03/10/installing-postgresql-82-on-leopard-with-macports/</li>
* </ul>
* PostgreSQL documentation is at:<ul>
* <li>http://www.postgresql.org/docs/8.3/interactive/index.html</li>
* </ul>
*
* @author Florian Jenett - mail@florianjenett.de
*
* created: 2008-11-29 17:49:23 - fjenett
* modified: fjenett 20081129
*
* @since 0.0.1
* @version 0.0.7
*
*/
public class PostgreSQL
extends de.bezier.data.sql.SQL
{
public PostgreSQL ( PApplet _papplet, String _database )
{
// should not be used
}
/**
* Creates a new PostgreSQL connection.
*
* @param _papplet Normally you'd pass "this" in for your sketch
* @param _server The server running the database, try "localhost"
* @param _database Name of the database
* @param _user Username for that database
* @param _pass Password for user
*/
public PostgreSQL ( PApplet _papplet, String _server, String _database, String _user, String _pass )
{
super( _papplet, _server, _database, _user, _pass );
init();
}
private void init ()
{
this.driver = "org.postgresql.Driver";
this.type = "postgresql";
this.url = "jdbc:" + type + "://" + server + "/" + database;
}
}
+856
Ver Arquivo
@@ -0,0 +1,856 @@
package de.bezier.data.sql;
import processing.core.*;
import java.io.*;
import java.sql.*;
/**
* SQL library for Processing 1.0
*
* see:<ul>
* <li>http://www.mysql.com/products/connector/j/</li>
* <li>http://java.sun.com/products/jdbc/</li>
* <li>http://www.toxi.co.uk/blog/2007/07/using-javadb-and-db4o-in-processing.htm</li>
* <li>http://www.tom-carden.co.uk/2007/07/30/a-quick-note-on-using-sqlite-in-processing/</li>
* </ul>
*
* @author Florian Jenett - mail@florianjenett.de
*
* created: 07.05.2005 - 12:46 Uhr
* modified: fjenett 20070801
*
* @since 004
* @version 005 - added more general SQL, simplyfied MySQL
*
*/
public class SQL
{
PApplet papplet;
public String server;
public String database;
public String url;
public String user;
protected String pass;
public String driver = "";
public String type = "";
public java.sql.Connection connection;
public String previousQuery;
public java.sql.Statement statement;
public java.sql.ResultSet result;
private boolean DEBUG = true;
/**
* Do not use this contructor.
*/
public SQL ()
{
System.out.println("SQL(): Please use this constructor\r\tSQL ( String _serv, String _db, String _u, String _p, PApplet _pa )");
}
/**
* You should not directly use the SQL.class instead use the classes for your database type.
*/
public SQL ( PApplet _pa, String _db )
{
this.user = "";
this.pass = "";
this.server = "";
String f = _pa.dataPath(_db);
File ff = new File(f);
if ( !ff.exists() || !ff.canRead() )
{
f = _pa.sketchPath( _db );
ff = new File(f);
if ( !ff.exists() || !ff.canRead() )
{
f = _db;
ff = new File(f);
if ( !ff.exists() || !ff.canRead() )
{
System.err.println("Sorry can't find any file named "+_db+" make sure it exists and the path is correct.");
}
}
}
_pa.println( "Using this database: " + f );
this.database = f;
this.url = "jdbc:" + type + ":" + database;
this.papplet = _pa;
papplet.registerDispose( this );
}
/**
* You should not directly use the SQL.class instead use the classes for your database type.
*/
public SQL ( PApplet _pa, String _serv, String _db, String _u, String _p )
{
this.server = _serv;
this.database = _db;
this.url = "jdbc:" + type + "://" + server + "/" + database;
this.user = _u;
this.pass = _p;
this.papplet = _pa;
papplet.registerDispose( this );
}
/**
* Open the database connection with the parameters given in the contructor.
*/
public boolean connect()
{
if ( driver == null || driver.equals("") ||
type == null || type.equals("") )
{
System.out.println( "SQL.connect(): You have to set a driver and type first." );
return false;
}
// TODO: need to add mechanisms for different connection types and parameters, see:
// http://jdbc.postgresql.org/documentation/83/connect.html
try
{
Class.forName(driver);
connection = java.sql.DriverManager.getConnection(url, user, pass);
}
catch (ClassNotFoundException e)
{
System.out.println( "SQL.connect(): Could not find the database driver ( "+driver+" ).\r" );
if (DEBUG) e.printStackTrace();
return false;
}
catch (java.sql.SQLException e)
{
System.out.println( "SQL.connect(): Could not connect to the database ( "+url+" ).\r" );
if (DEBUG) e.printStackTrace();
return false;
}
// removed finally block, thanks nao
return true;
}
/**
* Execute a SQL command on the open database connection.
*
* @param _sql The SQL command to execute
*/
public void execute ( String _sql )
{
if ( connection == null )
{
System.out.println( "SQL.query(): You need to connect() first." );
return;
}
previousQuery = _sql;
try
{
if ( statement == null )
{
statement = connection.createStatement();
}
statement.execute( _sql );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.query(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
}
/**
* Issue a query on the open database connection
*
* @param _sql SQL command to execute for the query
*/
public void query ( String _sql )
{
if ( connection == null )
{
System.out.println( "SQL.query(): You need to connect() first." );
return;
}
previousQuery = _sql;
try
{
if ( statement == null )
{
statement = connection.createStatement();
}
result = statement.executeQuery( _sql );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.query(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
}
/**
* Check if more results (rows) are available. This needs to be called before any results can be retrieved.
*
* @return boolean true if more results are available, false otherwise
*/
public boolean next ()
{
if ( result == null )
{
System.out.println( "SQL.next(): You need to query() something first." );
return false;
}
try
{
return result.next();
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.next(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return false;
}
/**
* Read an integer value from the specified field.
* Represents an INT / INTEGER type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return int Value of the field or 0
*/
public int getInt ( String _field )
{
// TODO: 0 does not seem to be a good return value for a numeric field to indicate failure
// same goes for other numeric fields
if ( result == null )
{
System.out.println( "SQL.getInt(): You need to query() something first." );
return 0;
}
try
{
return result.getInt( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getInt(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0;
}
public int getInt ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getInt(): You need to query() something first." );
return 0;
}
try
{
return result.getInt( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getInt(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0;
}
/**
* Read a long value from the specified field.
* Represents a BIGINT type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return long Value of the field or 0
*/
public long getLong ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getLong(): You need to query() something first." );
return 0;
}
try
{
return result.getLong( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getLong(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0;
}
public long getLong ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getLong(): You need to query() something first." );
return 0;
}
try
{
return result.getLong( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getLong(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0;
}
/**
* Read a float value from the specified field.
* Represents a REAL type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return float Value of the field or 0
*/
public float getFloat ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getFloat(): You need to query() something first." );
return 0.0f;
}
try
{
return result.getFloat( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getFloat(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0.0f;
}
public float getFloat ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getFloat(): You need to query() something first." );
return 0.0f;
}
try
{
return result.getFloat( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getFloat(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0.0f;
}
/**
* Read a double value from the specified field.
* Represents FLOAT and DOUBLE types:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return double Value of the field or 0
*/
public double getDouble ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getDouble(): You need to query() something first." );
return 0.0;
}
try
{
return result.getDouble( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getDouble(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0.0;
}
public double getDouble ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getDouble(): You need to query() something first." );
return 0.0;
}
try
{
return result.getDouble( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getDouble(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return 0.0;
}
/**
* Read a java.math.BigDecimal value from the specified field.
* Represents DECIMAL and NUMERIC types:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return java.math.BigDecimal Value of the field or null
*/
public java.math.BigDecimal getBigDecimal ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getBigDecimal(): You need to query() something first." );
return null;
}
try
{
return result.getBigDecimal( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getBigDecimal(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public java.math.BigDecimal getBigDecimal ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getBigDecimal(): You need to query() something first." );
return null;
}
try
{
return result.getBigDecimal( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getBigDecimal(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Read a boolean value from the specified field.
* Represents BIT type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return boolean Value of the field or 0
*/
public boolean getBoolean ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getBoolean(): You need to query() something first." );
return false;
}
try
{
return result.getBoolean( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getBoolean(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return false;
}
public boolean getBoolean ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getBoolean(): You need to query() something first." );
return false;
}
try
{
return result.getBoolean( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getBoolean(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return false;
}
/**
* Read a String value from the specified field.
* Represents VARCHAR and CHAR types:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return String Value of the field or null
*/
public String getString ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getString(): You need to query() something first." );
return null;
}
try
{
return result.getString( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getString(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public String getString ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getString(): You need to query() something first." );
return null;
}
try
{
return result.getString( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getString(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Read a java.sql.Date value from the specified field.
* Represents DATE type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return java.sql.Date Value of the field or null
*/
public java.sql.Date getDate ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getDate(): You need to query() something first." );
return null;
}
try
{
return result.getDate( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getDate(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public java.sql.Date getDate ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getDate(): You need to query() something first." );
return null;
}
try
{
return result.getDate( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getDate(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Read a java.sql.Time value from the specified field.
* Represents TIME type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return java.sql.Time Value of the field or null
*/
public java.sql.Time getTime ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getTime(): You need to query() something first." );
return null;
}
try
{
return result.getTime( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getTime(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public java.sql.Time getTime ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getTime(): You need to query() something first." );
return null;
}
try
{
return result.getTime( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getTime(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Read a java.sql.Timestamp value from the specified field.
* Represents TIMESTAMP type:
* http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/mapping.html
* "8.9.6 Conversions by ResultSet.getXXX Methods"
*
* @param _field The name of the field
* @return java.sql.Timestamp Value of the field or null
*/
public java.sql.Timestamp getTimestamp ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getTimestamp(): You need to query() something first." );
return null;
}
try
{
return result.getTimestamp( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getTimestamp(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public java.sql.Timestamp getTimestamp ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getTimestamp(): You need to query() something first." );
return null;
}
try
{
return result.getTimestamp( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getTimestamp(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Read a value from the specified field to hav it returned as an object.
*
* @param _field The name of the field
* @return Object Value of the field or null
*/
public Object getObject ( String _field )
{
if ( result == null )
{
System.out.println( "SQL.getObject(): You need to query() something first." );
return null;
}
try
{
return result.getObject( _field );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getObject(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
public Object getObject ( int _column )
{
if ( result == null )
{
System.out.println( "SQL.getObject(): You need to query() something first." );
return null;
}
try
{
return result.getObject( _column );
}
catch ( java.sql.SQLException e )
{
System.out.println( "SQL.getObject(): java.sql.SQLException.\r" );
if (DEBUG) e.printStackTrace();
}
return null;
}
/**
* Close the database connection
*/
public void close()
{
dispose();
}
/**
* Callback function for PApplet.registerDispose()
*/
public void dispose ()
{
if ( result != null )
{
try
{
result.close();
}
catch ( java.sql.SQLException e ) { ; }
result = null;
}
if ( statement != null )
{
try
{
statement.close();
}
catch ( java.sql.SQLException e ) { ; }
statement = null;
}
if ( connection != null )
{
try
{
connection.close();
}
catch ( java.sql.SQLException e ) { ; }
connection = null;
}
}
}
+67
Ver Arquivo
@@ -0,0 +1,67 @@
package de.bezier.data.sql;
import processing.core.*;
/**
* SQLite wrapper for SQL library for Processing 1.0
* <p>
* A wrapper around some of sun's java.sql.* classes
* and the pure java "org.sqlite.JDBC" driver by zentus.com (BSD).
* </p>
* see:<ul>
* <li>http://www.zentus.com/sqlitejdbc/</li>
* <li>http://files.zentus.com/sqlitejdbc/</li>
* <li>http://java.sun.com/products/jdbc/</li>
* </ul>
*
*
* @author Florian Jenett - mail@florianjenett.de
*
* created: 2008-11-29 12:15:15 - fjenett
* modified: fjenett 20081129
*
* @since 0.0.7
* @version 0.0.7
*
*/
public class SQLite
extends de.bezier.data.sql.SQL
{
/**
* Creates a new SQLite connection.
*
* @param _papplet Your sketch, pass "this" in here
* @param _database Path to the database file, if this is just a name the data and sketch folders are searched for the file
*/
public SQLite ( PApplet _papplet, String _database )
{
super( _papplet, _database );
init();
}
/**
* Creates a new SQLite connection, same as SQLite( PApplet, String )
*
* @param _papplet Your sketch, pass "this" in here
* @param _server Ignored
* @param _database Path to the database file, if this is just a name the data and sketch folders are searched for the file
* @param _user Ignored
* @param _pass Ignored
*/
public SQLite ( PApplet _papplet, String _server, String _database, String _user, String _pass )
{
this( _papplet, _database );
}
private void init ()
{
this.driver = "org.sqlite.JDBC";
this.type = "sqlite";
this.url = "jdbc:" + type + ":" + database;
}
}
+164
Ver Arquivo
@@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<!--
(1) replace the following placeholders:
##yourLibrary## with the name of your library
##author## with your name
##date## with the current date
##versionNumber## with the current version number of your library.
##yourLink## to this page or your homepage.
(2) make adjustments to any item below where necessary.
-->
<title>##yourLibrary##</title>
<meta name="description" content="a library for the programming environment processing" />
<meta name="keywords" content="##author##, ##yourLibrary##, ##keywords##" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="ROBOTS" content="index,follow,archive" />
<meta http-equiv="imagetoolbar" content="false" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="author" content="##author##" />
<meta name="Rating" content="General" />
<meta name="revisit-after" content="7 Days" />
<meta name="doc-class" content="Living Document" />
<link rel="stylesheet" type="text/css" href="./stylesheet.css">
</head>
<body>
<div id="container">
<div id="header">
<h1>##yourLibrary##</h1>
<p>by <a href="###yourLink##">##author##</a></p>
</div>
<br class="clear" />
<div id="menu">
<ul>
<li><a href="#about">About</a> \ </li>
<li><a href="#download">Download</a> \ </li>
<li><a href="#download">Installation</a> \ </li>
<li><a href="#examples">Examples</a> \ </li>
<!-- <li><a href="#demos">Demos</a> \ </li> -->
<!-- <li><a href="#misc">Misc</a> \ </li> -->
<li><a href="./documentation" target="_blank">Documentation</a></li>
</ul>
</div>
<br class="clear" />
<div id="content" class="clear" style="margin-top:40px;">
<div id="about">
<h2>##yourLibrary##.</h2>
<p>
a library for the programming environment <a href="http://www.processing.org" target="_blank">processing</a>.<br />
last update, ##date##.
</p>
<p>
SQLibrary lets you communicate with a MySQL, PostgreSQL or SQLite database.
</p>
<p>
<em>please note: working with a remote database in a plublicly accessible applet is highly insecure.</em>
</p>
</div>
<br class="clear" />
<div id="download">
<h2>download</h2>
<p>
download ##yourLibrary## version ##versionNumber## in <a href="./download/##yourLibrary##-##versionNumber##.zip">.zip format</a>
</p>
<h2>installation</h2>
<p>
before trying to use this library with any database make sure you have that up and running.
the library is just a wrapper to help connect to <em>already installed and running</em> databases (MySQL, SQLite, PostgreSQL).
</p>
<p>
installing the library itself:
<ul>
<li>quit processing</li>
<li>find your <em>sketchbook</em> folder, <a href="http://www.processing.org/reference/environment/#Sketchbook" >see second paragraph here</a></li>
<li>add a folder called <em>libraries</em> (lowercase) to your sketchbook if its not already there</li>
<li>move the <em>##yourLibrary##-##versionNumber##.zip</em> into that <em>libraries</em> folder</li>
<li>unzip it in place</li>
<li>rename it to <em>##yourLibrary##</em></li>
<li>start processing and run one of the included examples to see if the lib is working</li>
</ul>
</p>
</div>
<div id="resources">
<p><strong>keywords</strong>
##keywords##
</p>
<p><strong>documentation</strong>. have a look at the online documentation <a href="./documentation/index.html" target="_blank">here</a>. a copy of the documentation is included in the .zip as well.
</p>
<p><strong>source</strong>. the source code is included in the download.
</p>
</div>
<br class="clear" />
<div id="examples">
<h2>examples</h2>
<p>
find a list of examples in the current distribution of ##yourLibrary##, or have a look at them by following the links below.
<ul>
##examples##
</ul>
</p>
</div>
<div id="info">
<h2>tested</h2>
<p>
<!-- on which platform has the library been tested? -->
<strong>platform</strong> osx
<!-- which processing version did you use for testing your library? -->
<br /><strong>processing</strong> 1.0 (016x)
<!-- does your library depend on any other library or framework? -->
<br /><strong>dependencies</strong> mysql, sqlite and postgresql jdbc drivers (all included)
</p>
</div>
<br class="clear" />
<!-- use the demos section for a list of applets run in a browser. -->
<div id="demos">
<h2>demos</h2>
<p>
You've built something nice with this lib? Mail me the link and i'm happy to "add" you to "the list below".
<!--ul>
<li><a href="./applets/demo/index.html">demo</a></li>
</ul-->
</p>
</div>
<br class="clear" />
<!-- use the misc section to for other relevant information. activate the link to the misc section in the menu above. -->
<div id="misc">
<p></p>
</div>
<br class="clear" />
</div>
<div id="footer">
by ##author##, 2008. &nbsp;|&nbsp;
included jdbc drives are available from <a href="http://www.mysql.com/products/connector/j/">MySQL AB</a>, <a href="http://www.zentus.com/sqlitejdbc/">David Crawshaw</a> and <a>PostgreSQL
</a>.
</div>
</div>
</body>
</html>
+222
Ver Arquivo
@@ -0,0 +1,222 @@
/* processingLibs style by andreas schlegel, sojamo. */
body, div, h1, h2, h3, h4, h5, h6, p, a, ul, li, strong {
margin:0;
padding:0;
border:0;
}
body {
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size : 100%;
font-size : 0.7em;
font-weight : normal;
line-height : normal;
}
div {
margin-bottom:40px;
}
#container {
background-color:#fff;
width:750px;
}
#header,
#menu,
#about,
#download,
#examples,
#demos,
#misc {
padding-left:60px;
}
#header {
float:left;
padding-top:20px;
width:690px;
margin-bottom:0px;
}
#menu {
padding-top:6px;
float:left;
margin-bottom:40px;
height:20px;
width:690px;
}
#about,
#download,
#examples,
#demos,
#misc {
width:400px;
float:left;
}
#resources, #info {
width:200px;
margin-right: 20px;
float:right;
}
.clear {
clear:both;
}
#footer {
margin-top:300px;
height:20px;
padding-left:60px;
padding-top:6px;
}
ul {
list-style:none;
padding:0;
margin:0;
}
#menu li {
float:left;
padding-right:6px;
}
/* Headings */
h1 {
font-size:1.5em;
}
h2, h3, h4, h5, th {
font-size:1.0em;
}
p {
font-size:1em;
width:90%;
margin-bottom:20px;
}
pre, code {
font-family:"Courier New", Courier, monospace;
font-size:1em;
line-height:normal;
}
strong {
font-weight:normal;
}
hr {
border:0;
height:1px;
margin-bottom:24px;
}
a {
text-decoration: underline;
font-weight: normal;
}
a:hover,
a:active {
text-decoration: underline;
font-weight: normal;
}
a:visited,
a:link:visited {
text-decoration: underline;
font-weight: normal;
}
img {
border: 0px solid #000000;
}
/* COLORS */
body {
color : #333333;
background-color :#E2E2CC;
}
#header {
background-color:#000;
color:#fff;
}
h1, h2, h3, h4, h5, h6 {
color:#5A5A46;
}
pre, code {
color: #000000;
}
a,strong {
color: #3399CC;
}
a:hover,
a:active {
color: #3399CC;
}
a:visited,
a:link:visited {
color: #3399CC;
}
#footer, #menu {
background-color:#5A5A4E;
color:#fff;
}
#footer a, #menu a {
color:#fff;
}