<?xml version="1.0"?>
<persistence version="1.0">
<persistence-unit name="openjpa">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>tutorial.Animal</class>
<class>tutorial.Dog</class>
<class>tutorial.Rabbit</class>
<class>tutorial.Snake</class>
<properties>
<property name="openjpa.ConnectionURL" value="jdbc:hsqldb:tutorial_database"/>
<property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
<property name="openjpa.ConnectionUserName" value="sa"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
</properties>
</persistence-unit>
</persistence>
String url = "https://www.google.com.ua/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjM6qWHxsrOAhXLNxQKHY9pBW8QFggaMAA&url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2572566%2Fjava-jpa-version-annotation&usg=AFQjCNHo2lEs_AU2l38GU9-kO2hGaR5F9g&sig2=1TYjOkH85bUsfa7ddPgSsQ&bvm=bv.129759880,d.bGg";
int beginIndex = url.indexOf("&url=") + 5;
int endIndex = url.indexOf('&', beginIndex);
String substring = url.substring(beginIndex, endIndex);
System.out.println(substring);
// http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2572566%2Fjava-jpa-version-annotation
System.out.println(URLDecoder.decode(substring, "utf8"));
// http://stackoverflow.com/questions/2572566/java-jpa-version-annotation
TreeSet<Double> doubles = new TreeSet<>(Arrays.asList(1.34, 2.34, 3.34, 1.74, 0.34));
System.out.println(doubles.last());
double max = NumberUtils.max(1.34, 2.34, 3.34, 1.74, 0.34);
System.out.println(max);
<c:set var="json_text">
[{"TIME_STAMP": "2016-07-25 02:30:22", "COUNTER": "COUNT_ALL", "VALUE": 635 }, { "TIME_STAMP": "2016-07-25 02:30:22", "COUNTER": "COUNT_BAD", "VALUE": 1 }, { "TIME_STAMP": "2016-07-25 02:30:22", "COUNTER": "QUALITY", "VALUE": 99.84 }, { "TIME_STAMP": "2016-07-25 02:31:22", "COUNTER": "COUNT_ALL", "VALUE": 642 }, { "TIME_STAMP": "2016-07-25 02:31:22", "COUNTER": "COUNT_BAD", "VALUE": 1 }, { "TIME_STAMP": "2016-07-25 02:31:22", "COUNTER": "QUALITY", "VALUE": 99.84 }]
</c:set>
<script>
var jsonObj = ${json_text};
</script>
public class Driver extends NonRegisteringDriver implements java.sql.Driver {
static { // статический блок
try {
java.sql.DriverManager.registerDriver(new Driver());
} catch (SQLException E) {
throw new RuntimeException("Can't register driver!");
}
}
// остальной код опущен
}
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root");
class A {
public void superMethod() {}
}
class B extends A {
@Override
public void superMethod() {}
}