P
P
P_Alexander2018-01-25 16:58:49
PHP
P_Alexander, 2018-01-25 16:58:49

How to load data from a file or xml file into the database?

I am writing a java ee application on a servlet, the question is, how can I make sure that when the server (TomCat) starts, the database is filled with data from a file or xml file, How is this done at all? is written in the web.xml configuration?
Articles or examples will be very happy! Thank you.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
Lazy @BojackHorseman PHP, 2019-11-10
Tag

regular expression

N
Newn, 2019-11-10
@Newn

if the string is known in advance and is static, then find can be used.

A
AUser0, 2019-11-10
@AUser0

Variant without taking into account the text encoding:

$str = "abcd - абвг.";
if (preg_match("/^[a-zA-Zа-яА-Я0-9\-_. ]+$/s", $str))
{
    // выполнить PHP код
}

S
Strabbo, 2018-01-25
@Strabbo

Try LOAD DATA INFILE

A
Alexey Kopendakov, 2018-01-26
@alex_kag

The question is not clear. Interested in the way to fill the base? Or are you interested in a way to do this when deploying the application and every restart of the server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question