Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread stefanos sofroniou
Hector, here's the link from official SQLite website about Flags for File 
opening operations: 

http://www.sqlite.org/c3ref/c_open_autoproxy.html

Unfortunately I don't know anything (yet!) about SQLite under Java. If you need 
any other kind of help, let me know.


>
> From: Hector Guilarte <hector...@gmail.com>
>To: sqlite-users@sqlite.org 
>Sent: Thursday, June 28, 2012 4:08 PM
>Subject: Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly
> 
>Hello?
>
>I'm starting to feel hopeless, No luck in StackOverflow and no luck here
>:-(...
>
>Well, i guess it just can't be done.
>
>On Wed, Jun 27, 2012 at 10:13 AM, Hector Guilarte <hector...@gmail.com>wrote:
>
>> Hello everyone,
>>
>> I'm new to SQLite as well as to this list. I'm writing because I was
>> planning on using SQLite for a personal -but public- project that I wanted
>> to make available through Google App Engine. It is basically a SQLite to
>> CSV converter and a SQLite to VCard converter. In other words, I have an
>> Address Book in a SQLite database and I wanted to export it to a well-known
>> format for importing it to some other places, as CSV and as VCard.
>>
>> I already placed my question in StackOverflow.com last friday with no
>> luck, it has only been seen 21 times and the only answer I received was not
>> helpfull since it was telling me somehing like "first use something like
>> what you are trying to develop yourself and then use yours with their
>> output" (nahh, I'm kidding, but the real answer is not far from that and it
>> can be seen here:
>> http://stackoverflow.com/questions/11155537/load-sqlite-from-inputstream-in-java-as-readonly
>> )
>>
>> If somebody has an answer, even if it is "It's not possible at all, so
>> drop it" and is a stackoverflow user, feel free to go ahead and answer over
>> there to earn the points, but please post your answer here as well. Now my
>> question as I wrote it in StackOverflow:
>>
>> I have an App which receives a SQLite database to read some data and
>> export it as an CSV. I'm trying to upload it to Google App Engine but I
>> faced a huge problem which I think makes it impossible to use the GAE for
>> this app.
>>
>> The problem is that since on the GAE I can't write to the FileSystem, I
>> can't open the JDBC Connection to the SQLite file and therefore I can't
>> read the data to convert to CSV. I've been looking for other options such
>> as Google Cloud Storage, but I don't want to use my only "free trial" of it
>> on this application, and actually I don't want to have to pay ever for this
>> app after the Free Trial ends, so this is not an option.
>>
>> After a lot of research, my only guess is that I might be able to load the
>> database straight from the InputStream as I received it from the upload
>> form I'm using to get it, however, this is a 100% lucky guess and I've not
>> been able to find anything about this approach online, but I just don't
>> want to believe it can't be done with any of the existing JDBC libraries to
>> SQLite and I'm hoping somebody here will tell me how to do it.
>>
>> If the InputStream approach is not possible, but you know some other way
>> to open a SQLite DB in GAE to READ ONLY, and then dispose it, feel free to
>> comment as well...
>>
>> If there is another option like "don't use JDBC, use a socket connection
>> with a pipe to open the connection with the InputStream", I'd also like to
>> hear that, it does not HAVE to be done with JDBC.
>>
>> Thanks a lot,
>>
>> Héctor Guilarte
>>
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Sylvain Pointeau
It will not be possible with SQLite but it would be possible using H2.
http://www.h2database.com/html/advanced.html#file_system

maybe you could convert the sqlite to H2 somewhere in your process?

Best regards,
Sylvain
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Pavel Ivanov
On Thu, Jun 28, 2012 at 9:54 AM, Hector Guilarte  wrote:
> I don't think it would.
>
> Connection conn = DriverManager.getConnection("jdbc:sqlite:sample.db",
> config.toProperties());
>
> is telling to open a connection to the file "sample.db" which is located in
> the same folder as the application is executing, but is going for a *file*.
> However, I'm going to check what configuration properties can be passed to
> the method to see if one says something about a socket, an inputStream or
> something like that.

SQLite works only with files, nothing else. You could have some luck
feeding other types of data to SQLite if JDBC supports notion of
SQLite's VFS (Virtual File System) or if you use some other language
that supports it (e.g. C/C++). But even then you will have really hard
time trying to feed socket or inputStream to it, because they are
stream-like and support only consecutive reading while SQLite needs
random access to the data. How e.g. you'll execute operation "read
1024 bytes at offset 10240" on a stream? The only way you can do that
is to read everything from stream and then give to SQLite what it
needs. But then you can save everything you read from stream into a
temporary file and open that temporary file in SQLite.

Pavel
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Hector Guilarte
I don't think it would.

Connection conn = DriverManager.getConnection("jdbc:sqlite:sample.db",
config.toProperties());

is telling to open a connection to the file "sample.db" which is located in
the same folder as the application is executing, but is going for a *file*.
However, I'm going to check what configuration properties can be passed to
the method to see if one says something about a socket, an inputStream or
something like that.

Thanks!

On Thu, Jun 28, 2012 at 3:37 PM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> Does this article help?
>
>
> http://stackoverflow.com/questions/4574303/java-sqlite-how-to-open-database-as-read-only
>
>
>
>
>
> Michael D. Black
>
> Senior Scientist
>
> Advanced Analytics Directorate
>
> Advanced GEOINT Solutions Operating Unit
>
> Northrop Grumman Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of Hector Guilarte [hector...@gmail.com]
> Sent: Thursday, June 28, 2012 8:22 AM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly
>
> Because I want it to run on Google App Engine. GAE doesn't allow to write
> to the FileSystem, so I can't open the JDBC Connection to the SQLite file
> and therefore I can't read the data to convert to CSV.
>
> I upload the file to Google App Engine with a HTML form and that's how I
> get it in an InputStream
>
> On Thu, Jun 28, 2012 at 3:19 PM, OBones <obo...@free.fr> wrote:
>
> > If you've got the database in a stream, why can't you save it to a disk
> > file and then use this file with sqlite?
> >
> > __**_
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users<
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users%3Chttp://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Black, Michael (IS)
Does this article help?

http://stackoverflow.com/questions/4574303/java-sqlite-how-to-open-database-as-read-only





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Hector Guilarte [hector...@gmail.com]
Sent: Thursday, June 28, 2012 8:22 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

Because I want it to run on Google App Engine. GAE doesn't allow to write
to the FileSystem, so I can't open the JDBC Connection to the SQLite file
and therefore I can't read the data to convert to CSV.

I upload the file to Google App Engine with a HTML form and that's how I
get it in an InputStream

On Thu, Jun 28, 2012 at 3:19 PM, OBones <obo...@free.fr> wrote:

> If you've got the database in a stream, why can't you save it to a disk
> file and then use this file with sqlite?
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users<http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users%3Chttp://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Hector Guilarte
Because I want it to run on Google App Engine. GAE doesn't allow to write
to the FileSystem, so I can't open the JDBC Connection to the SQLite file
and therefore I can't read the data to convert to CSV.

I upload the file to Google App Engine with a HTML form and that's how I
get it in an InputStream

On Thu, Jun 28, 2012 at 3:19 PM, OBones  wrote:

> If you've got the database in a stream, why can't you save it to a disk
> file and then use this file with sqlite?
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread OBones
If you've got the database in a stream, why can't you save it to a disk 
file and then use this file with sqlite?


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Hector Guilarte
Hello?

I'm starting to feel hopeless, No luck in StackOverflow and no luck here
:-(...

Well, i guess it just can't be done.

On Wed, Jun 27, 2012 at 10:13 AM, Hector Guilarte <hector...@gmail.com>wrote:

> Hello everyone,
>
> I'm new to SQLite as well as to this list. I'm writing because I was
> planning on using SQLite for a personal -but public- project that I wanted
> to make available through Google App Engine. It is basically a SQLite to
> CSV converter and a SQLite to VCard converter. In other words, I have an
> Address Book in a SQLite database and I wanted to export it to a well-known
> format for importing it to some other places, as CSV and as VCard.
>
> I already placed my question in StackOverflow.com last friday with no
> luck, it has only been seen 21 times and the only answer I received was not
> helpfull since it was telling me somehing like "first use something like
> what you are trying to develop yourself and then use yours with their
> output" (nahh, I'm kidding, but the real answer is not far from that and it
> can be seen here:
> http://stackoverflow.com/questions/11155537/load-sqlite-from-inputstream-in-java-as-readonly
> )
>
> If somebody has an answer, even if it is "It's not possible at all, so
> drop it" and is a stackoverflow user, feel free to go ahead and answer over
> there to earn the points, but please post your answer here as well. Now my
> question as I wrote it in StackOverflow:
>
> I have an App which receives a SQLite database to read some data and
> export it as an CSV. I'm trying to upload it to Google App Engine but I
> faced a huge problem which I think makes it impossible to use the GAE for
> this app.
>
> The problem is that since on the GAE I can't write to the FileSystem, I
> can't open the JDBC Connection to the SQLite file and therefore I can't
> read the data to convert to CSV. I've been looking for other options such
> as Google Cloud Storage, but I don't want to use my only "free trial" of it
> on this application, and actually I don't want to have to pay ever for this
> app after the Free Trial ends, so this is not an option.
>
> After a lot of research, my only guess is that I might be able to load the
> database straight from the InputStream as I received it from the upload
> form I'm using to get it, however, this is a 100% lucky guess and I've not
> been able to find anything about this approach online, but I just don't
> want to believe it can't be done with any of the existing JDBC libraries to
> SQLite and I'm hoping somebody here will tell me how to do it.
>
> If the InputStream approach is not possible, but you know some other way
> to open a SQLite DB in GAE to READ ONLY, and then dispose it, feel free to
> comment as well...
>
> If there is another option like "don't use JDBC, use a socket connection
> with a pipe to open the connection with the InputStream", I'd also like to
> hear that, it does not HAVE to be done with JDBC.
>
> Thanks a lot,
>
> Héctor Guilarte
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-27 Thread Hector Guilarte
Hello everyone,

I'm new to SQLite as well as to this list. I'm writing because I was
planning on using SQLite for a personal -but public- project that I wanted
to make available through Google App Engine. It is basically a SQLite to
CSV converter and a SQLite to VCard converter. In other words, I have an
Address Book in a SQLite database and I wanted to export it to a well-known
format for importing it to some other places, as CSV and as VCard.

I already placed my question in StackOverflow.com last friday with no luck,
it has only been seen 21 times and the only answer I received was not
helpfull since it was telling me somehing like "first use something like
what you are trying to develop yourself and then use yours with their
output" (nahh, I'm kidding, but the real answer is not far from that and it
can be seen here:
http://stackoverflow.com/questions/11155537/load-sqlite-from-inputstream-in-java-as-readonly
)

If somebody has an answer, even if it is "It's not possible at all, so drop
it" and is a stackoverflow user, feel free to go ahead and answer over
there to earn the points, but please post your answer here as well. Now my
question as I wrote it in StackOverflow:

I have an App which receives a SQLite database to read some data and export
it as an CSV. I'm trying to upload it to Google App Engine but I faced a
huge problem which I think makes it impossible to use the GAE for this app.

The problem is that since on the GAE I can't write to the FileSystem, I
can't open the JDBC Connection to the SQLite file and therefore I can't
read the data to convert to CSV. I've been looking for other options such
as Google Cloud Storage, but I don't want to use my only "free trial" of it
on this application, and actually I don't want to have to pay ever for this
app after the Free Trial ends, so this is not an option.

After a lot of research, my only guess is that I might be able to load the
database straight from the InputStream as I received it from the upload
form I'm using to get it, however, this is a 100% lucky guess and I've not
been able to find anything about this approach online, but I just don't
want to believe it can't be done with any of the existing JDBC libraries to
SQLite and I'm hoping somebody here will tell me how to do it.

If the InputStream approach is not possible, but you know some other way to
open a SQLite DB in GAE to READ ONLY, and then dispose it, feel free to
comment as well...

If there is another option like "don't use JDBC, use a socket connection
with a pipe to open the connection with the InputStream", I'd also like to
hear that, it does not HAVE to be done with JDBC.

Thanks a lot,

Héctor Guilarte
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users