>>You'll need to ensure security, using json web tokens for example

I have never used spark, looks fun (bad name for a project considering 
apache spark dominates the "spark" name). I was thinking Jetty would be 
pretty ideal, and/or restlet.  I also like Grizzly.  Vertx. is great, but 
maybe overkill and would require too many dependencies.

I was thinking that the http server could optionally be run using an SSL 
connector (JSSE SSL).  Most micro-server frameworks make pretty easy to use 
ssl.  This should sufficiently  handle security over the wire.

The format for querying the http server could be something like this in 
JSON:
{
    user: 'dbUserName',
    pass: 'password',
    sql: "slect * from users where name=? AND isIdiot=?",
    params: ['Adam', true]
}

the response would just be an json array of rows.


The server could be run standalone something like this:
java -jar httpH2.jar  -options <options.json>

The options.json would contain information like follwoing:
- path to DB:port
 -user name, password of h2 database
- embedded or TCP  (if embedded, the http server would run H2, else it will 
simply connect to an existing H2 TCP server over JDBC
- ip whitelist - list of ips that can access the http server
 -http port 
 - etc


On Thursday, February 23, 2017 at 6:13:28 AM UTC-5, Christian MICHON wrote:
>
> on point 2: it can be easily done with spark (sparkjava.com not apache 
> spark) + jooq
>
> You'll need to ensure security, using json web tokens for example.
>
> On Thursday, February 23, 2017 at 3:47:33 AM UTC+1, Adam McMahon wrote:
>>
>> Hi Group,
>>
>> i am considering a project that may require me to connect to an H2 
>> database froma non-JVM language (in this case php). I know the postgres 
>> driver might work and querus is an option, but I would like to consider a 
>> more general option: an http connector.
>>
>> It should be pretty easy to create a HTTP-JDBC bridge (perhaps an 
>> afternoon of work) that accepts a a post request (with a json payload 
>> describing the query) and return a json array of the results.  A simple 
>> servlet would do the trick that acts as a type of proxy to an underlying 
>> JDBC connection.
>>
>> My question is:
>>
>> [1] Perhaps this is already done in the web-console?  Is there 
>> documentation for how the server of the web-console could be used as a more 
>> general API over HTTP for H2?
>>
>> [2] Do you think anyone else would have use for this outside of my 
>> private projects?  I could fairly easily create a standalone sever (perhaps 
>> using embedded jetty) that would allow someone to  extend an H2 database 
>> over http. A few security things would need to be worked out, but it seems 
>> straight-forward.  This may be nice as it would open H2 to a variety of non 
>> JDBC languages (node.js, perl, php), using simple REST-like http 
>> requests...thoughts?
>>
>> -Adam
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to