How to update MySql Database from threading in java [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hi i have a java program which fetch json data from one website and we store that json data in our local Mysql database. From the local Mysql database we are using those values for some calculations. I wants to update my database after every 2 hours using API from the website. I don't know how to do that and I have never done it before. I can give the Structure of my database tell me if there is something i need to do in mysql data base or I have to use threading concept. Please suggest some tutorial or example.
I have a table Student with fields First_name, last_name and Roll_no I have not included any time or date. tell me if someone have some idea regarding the problem I'm facing .
I have used JDBC for database connection.
Thanks In advance

You just have to schedule your Java application for execution every two hours.
a) Write a cronjob to do so.
b) Create a Timer within your Java application which fires every two hours to restart the "update process"

Related

Create a database in IntelliJ IDEA [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have to create a database having the name Cars using any RDBMS (Oracle, Postgres, MySql, Java DB, etc.).
Then I have to create a user with the name "dbus" and the password "uspass"; and 2 tables.
Can any of you explain to me how I can create a database in intellij? I can't find any options.
I read somewhere that I have to download a database browser, I downloaded it and I don't think I can create a new database. As far as I understand, this "db browser" only establishes a connection to an existing database.
I just want to create a database where I can create some tables. Then with the connection I hope I can handle it.
For most data sources you have to provide the URL of the existing database where you can create tables, etc.
The database needs to already exist and you should use the administrative tools for the corresponding RDBMS to create a database and a user first. Only after that you can connect and work with this database in the IDE.
As far as I know, creating the database directly from IntelliJ IDEA is possible only for the Embedded Apache Derby data source:
P.S. Database plug-in is available only in IntelliJ IDEA Ultimate edition. And same functionality built into their separate product, DataGrip.

How do i change a grid in windows application automatically after change its table on DB? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a scenario that its will doing like a messenger !
Imagine i have a grid-view in Windows app and this Grid-View show all records on a table in my database . i need when something changed a record on database (insert - Update - Delete) automatically grid view in my windows app changed and updated with new records According to Data Base Table !
I know one of solution is used background worker in behind and use interval checking in Database table (for example for each 1 second) but it used resource of system so much. i want something that push records from database to windows app !! is There any solution for this propose ?
You can use the SignalR framework that push the data from the server to your application, it's usually used by ASP.NET but it can be used in desktop apps as well.
check this code for how to implement it: http://www.codeproject.com/Articles/804770/Implementing-SignalR-in-Desktop-Applications
Note: You will have to run a web server with the application
If by
grid-view in Windows app
you are using Windows Forms and you have a DataGridView, you can add a control of type BindingSource then bind the DataSource property of the grid to the database query that returns the data you want to display.

How would I go about storing data with this kind of app? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have this idea for an app (mainly for personal use) to write down homework or upcoming project due dates and save them, and maybe add alarms to help me not procrastinate.
My question is: how would I store assignments? I never actually made an app that stores user input so I don't know where to start. From what I know I can either start up an SQL db or use Shared Preferences which I'm not familiar with both. So my question is what's the advantages and disadvantages of either?
If you are using bulk amount of data and you want to store it in ordered way then you can use SQL db. In SQL db you can also do indexing.
In case of small data storage you can use shared preferences.
In your case you should definitely use db.
Check the official documentation, you will get more clear idea :
http://developer.android.com/guide/topics/data/data-storage.html

Can all users access the tables created in my schema? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've installed Oracle 12c, SQL Developer, and have created several tables...but in my schema.
I want to create a Oracle DB backend to a JAVA front end application.
Once created, are all schemas available to any user with the appropriate permissions or are they local to the user who created them?
That's more than one question. But, you create an account (or multiple accounts) to own the tables and stored procedures and functions. And yes, once created anyone can access it (as long as they have the required permissions). And yes, they can run the stored procedures and functions you create (again, if they have the required permissions).

How to save data of a small prog? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am building a small java application that shall run locally on a system. The data I intend to input is little stuff like my daily expenses, a couple of contacts I have, and a couple of notes of things I want to remember.
To save the data for this matter I think installing a database like MySQL or Oracle would be an overkill. In my past projects I always used those databases.
How would I have to manage the data of a small program? Are there any ready to use solutions in the java world? Maybe with the possibility to use it together with JPA?
You should look into Apache Derby:
http://db.apache.org/derby/
or HyperSQL:
http://hsqldb.org/
They're both lightweight database engines that you can fire up on application start-up, ideal for smaller projects. They also both have Hibernate dialects for JPA.

Categories

Resources