Copy any data from one database to another database

485 views
Skip to first unread message

Zulfukor Perdeshov

unread,
May 24, 2012, 10:40:41 AM5/24/12
to ORMLite Android Users
Hi!

I want copy any data from one database to another database in Android
project with ORMLite. I have general database that contain more data.
When using application the new records will saved to main database.
And I need copy new rows to another database when user want. It's
pollible on ORMLite? I know the ORMLite can switch databases.

Any idea?
Thanks.

David Fire

unread,
May 24, 2012, 11:22:01 AM5/24/12
to ormlite...@googlegroups.com
hi
make two helpers, each one pointing to a different database.
than just DB1Dao.create(whatever); DB2Dao.create(whatever);


2012/5/24 Zulfukor Perdeshov <zperd...@gmail.com>



--
 (\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

David Fire

unread,
May 24, 2012, 11:22:44 AM5/24/12
to ormlite...@googlegroups.com
sorry why 2 DB? maybe you can copy it to other table or add a column to mark it...

2012/5/24 David Fire <ddf...@gmail.com>

Zulfukor Perdeshov

unread,
May 24, 2012, 1:17:45 PM5/24/12
to ORMLite Android Users
Hi David Fire!

Thank you for reply. In my project need have 2 DB files. Because I
need upload any new records to Web service to save it in the server.
ORMLite can support multiple connection on one time for select from
first Database and to insert result rows to another Database. And If
destination Database is not Exist, can ORMLite create it automaticly?
Or I need create skeleton database file?

If you have any sample project for this question, can you share to
download? please.


Thanks!

Kind regards.



On 24 май, 20:22, David Fire <ddf...@gmail.com> wrote:
> sorry why 2 DB? maybe you can copy it to other table or add a column to
> mark it...
>
> 2012/5/24 David Fire <ddf...@gmail.com>
>
>
>
>
>
>
>
>
>
> > hi
> > make two helpers, each one pointing to a different database.
> > than just DB1Dao.create(whatever); DB2Dao.create(whatever);
>
> > 2012/5/24 Zulfukor Perdeshov <zperdes...@gmail.com>

David Fire

unread,
May 24, 2012, 1:45:58 PM5/24/12
to ormlite...@googlegroups.com
i dont have any example, but you can just make 2 helpers, one pointing to one DB and the other pointing to other DB with a different name.
if it is just to upload it, make a column ToUpload, after it is uploaded you can put it back to 0.


2012/5/24 Zulfukor Perdeshov <zperd...@gmail.com>

Zulfukor Perdeshov

unread,
May 25, 2012, 6:53:21 AM5/25/12
to ormlite...@googlegroups.com
Tanks for help, I created, 2 DBHelpers and now, I can copy any data from first Database to second database file. 
It's work for me.


четверг, 24 мая 2012 г., 22:45:58 UTC+5 пользователь David Faerman написал:

jitendra...@hiteshi.com

unread,
Apr 14, 2015, 12:55:34 AM4/14/15
to ormlite...@googlegroups.com
Hi Zulfukor,

I want to copy one table from one database to other database, how you could you done this.
Please help me.....!!!!!
Reply all
Reply to author
Forward
0 new messages