GithubHelp home page GithubHelp logo

fjenett / sql-library-processing Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 24.0 22.78 MB

SQLibrary – a SQL database library for Processing incl. MySQL, SQLite and PostgreSQL

Home Page: http://fjenett.github.com/sql-library-processing/

Java 82.64% CSS 8.08% HTML 9.27%

sql-library-processing's People

Contributors

benfry avatar erictheise avatar fjenett avatar timpulver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sql-library-processing's Issues

SELECT * FROM table WHERE x= String

Hi, i wanted to use a String to change my request to my DB.
Means i use a String called "search" for example.
So i could go search= "search1";
( "SELECT * FROM table WHERE x="search" ");

But it doesnt works.

However, if i put my request directly on my
("SELECT * FROM table WHERE x="search1"")
It works, indeed.

So i dont understand how to use a String (that i could change) to do my request to my DB.

Thanks for your help !

=> Sorry for my bad english, if you know what i mean :)

Add method to generate blank database

Mainly for SQLite, add method to generate db.sqlite at given path or in sketch folder:

mySqlDb.createDatabase("name.sqlite");
mySqlDb.createDatabase("/full/path/to/my/folder/name.sqlite");

How tu use resultSet with postgresql

Hello,

I wish to populate an array with the query result, and the normal way is with resultSet rs = pgsql.query(query); however I get the message 'cannot convert from void to resultset' even when importing additional libraries.
import de.bezier.data.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
String user = "postgres";
String pass = "a";
String database = "wordnet30";
ArrayList <String[]> result = new ArrayList<String[]>();

PostgreSQL pgsql;
pgsql = new PostgreSQL( this, "localhost:5432", "wordnet30", "postgres", "a" );
if ( pgsql.connect() )
{
//Statement st = conn.createStatement();
ResultSet rs = pgsql.query("SELECT * FROM ra");
int columnCount = rs.getMetaData().getColumnCount();
while(pgsql.next())
{
String[] row = new String[columnCount];
for (int i = 0; i < columnCount; i++)
{
row[i] = rs.getString(i+1);
}
result.add(row);

    }
}
else
{
}
Print(result);

Is there a way around this? Is it feasible to use the JDBC directly in Processing, and avoiding 'public static void main' ?
Best regards,
Nicholas Bloom

Processing 3 Compatibility

Attempting to use the library in Processing 3 gives the following error:

NoSuchMethodError: You may be using a library that's incompatible with this version of Processing.

Your library has been a critical part of my workflow and it would be tragic for it to not be updated to work with P3.

thanks!

das geht nicht

Was ist das in PostgreSQL, das geht nicht.

public String[] getTableNames ()
{
    if ( tableNames == null )
    {
        tableNames = new ArrayList<String>();
        query( "SELECT relname AS 'table_name' FROM pg_stat_user_tables WHERE schemaname='public'" );
        while ( next() ) {
            tableNames.add( getObject("table_name").toString() );
        }
    }
    return tableNames.toArray(new String[0]);
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.