connecting a database from html by using angular - html

I am trying to write a sample web project that connects MySQL and executing querys such as creating a new user and deleting an existing user.
I wrote all the querys (prepared statements) in java classes.
Now I am trying to write the html file so clicking a button will call the statements that are written in the java classes.
How can I do that, without using JSF?
I want to use Angular but I don't understand how to make that connection between the html file and the java classes. Is is possible with angular?
If not, should I just use the regular JSF to do so?
Thanks

Related

How to run javascript file with NodeJS on actual website after HTML form submit?

I am new to NodeJS, and I was wondering how I can get data after I submit a form on a webpage and store it into my mysql database on the same website. I know how to make the form, I know how to use NodeJS to insert a row in the mysql database. What I don't know is how to connect the two. Most tutorials on NodeJS involve a local server (not a real website), and all of the tutorials use the terminal and command line to get the app running. Is there some way I can use the 'action=""' feature of the HTML form to POST data to my database using NodeJS? How? I am very lost.

How can I interact with html file in delphi intraweb?

Hi I am currently working on delphi intraweb. I try to import html template file to the program instead of hard-code it by using components from tool palette. However, I cannot find anyway to interact with the html file satisfyingly. For example, I want to handle the values of input box in the html file or adding data to data table through delphi. Or should I perform the tasks through other aspects?
I am using IWTemplateProcessorHTML to load external html template to delphi but I couldnt figure out a way to pass values from the html file to delphi or from delphi to that html file in run-time. There is not coding involved yet.
Thanks.

Is it possible to save data to a json file on local disk using $resource.save without using any server side implementation?

I am trying to build an Employement Management App in AngularJS where a basic operation is adding an employee.
I am displaying details using a service and getting Json data from the mock json file i am using.
Similarly, can i add form data to a textfile on the harddisk.
I have seen it done in a tutorial using $resource.save.
If at all it is possible without any server side code please share the example,it would be helpful.
Thanks.
You can make use of HTML5 local browser storage, as this does not require folder access. Mode datails here http://diveintohtml5.info/storage.html
AngularJS has modules for local storage which you can use to access such storages like this https://github.com/grevory/angular-local-storage

Strategy searching and using csv values from html

i am pretty new to html and as part of project we have to create a game where the player has to select different tags and then gets rewarded according to a value which is stored in a .csv file.
I created the layout so far with diffrent buttons, now i want to know how can i search inside the csv file and return the corresponding value? I am using html and javascript so far.
There are about 6000 entries in this file. Is it wise to load them all into an array?
And how can i share variables between functions without calling them one after the other?
For example to find out how often a button was pressed i obviously could not use a var in a script since it would be lost after the script was executed so i had to create a html input text field to store the variable constantly.
Your help is appreciated :)
Regards,
Marcurion
It would be wise to use a DBMS, however if the project requirement is to use CSV you could use a server side programming language like PHP to read and write the CSV file.
I wouldnt recommend to load all entries in the array, instead you could only load what you need but this can be achieved by using a DBMS.
To share variables between functions on javascript you will need to declare them as global variables, you could google: "javascript variables scope" or "javascript global variables" and read a little more of scopes.
If you want to know how often the button was pressed you can make AJAX requests to a server side script that can handle what you need if the script needs to be submited or executed.
You could check out JQuery framework to use events, ajax and infinite other things.
My advice is for you to read a little more about javascript, a framework for javascript like JQuery and a little of server side languages like PHP, with these tools you can easily develop what you need.

How To load data that are accessed from database to html form

I am trying to access data from table with GetString() method and that data is stored in some variable then it must be loaded to html form when i am click the submit button. How to it? Please help me......
This question is too general.
In order to access the database you need a web server running server-side code in a language such as ASP.NET, Java, PHP, etc. The server code would be responsible for using a "GetString()" method to read the table and populate data in the form (or even better, return it to an MVC View or to JavaScript via AJAX to load it onto the HTML form).