Skip to content

Commit

Permalink
Utilisation bon vieux code java pour mesurer les temps d'execution su…
Browse files Browse the repository at this point in the history
…r BaseXmlFunctionsCaller
  • Loading branch information
jvk88511334 committed Nov 13, 2023
1 parent becce46 commit 85f077c
Showing 1 changed file with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,58 @@ public class BaseXmlFunctionsCaller {

@ColumnTransformer(read = "XMLSERIALIZE (CONTENT data_xml as CLOB)", write = "NULLSAFE_XMLTYPE(?)")
public String issnToPpn(String issn) throws SQLRecoverableException, UncategorizedSQLException {
long startTime = System.nanoTime();
StringBuilder request = new StringBuilder("SELECT AUTORITES.ISSN2PPNJSON('");
request.append(issn);
request.append("') as data_xml from DUAL");
return baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
String result = baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
long endTime = System.nanoTime();
// Temps d'exécution en secondes
double duration = (endTime - startTime) / 1_000_000_000.0;
System.out.println("Temps d'exécution : ISSN2PPNJSON(" + issn + ")" + duration + " secondes");
return result;
}

@ColumnTransformer(read = "XMLSERIALIZE (CONTENT data_xml as CLOB)", write = "NULLSAFE_XMLTYPE(?)")
public String isbnToPpn(String isbn) throws SQLRecoverableException, UncategorizedSQLException {
long startTime = System.nanoTime();
StringBuilder request = new StringBuilder("SELECT AUTORITES.ISBN2PPNJSON('");
request.append(isbn);
request.append("') as data_xml from DUAL");
return baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
String result = baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
long endTime = System.nanoTime();
// Temps d'exécution en secondes
double duration = (endTime - startTime) / 1_000_000_000.0;
System.out.println("Temps d'exécution : ISSN2PPNJSON(" + isbn + ")" + duration + " secondes");
return result;
}

@ColumnTransformer(read = "XMLSERIALIZE (CONTENT data_xml as CLOB)", write = "NULLSAFE_XMLTYPE(?)")
public String baconProvider035(Integer provider) throws SQLRecoverableException, UncategorizedSQLException {
long startTime = System.nanoTime();
StringBuilder request = new StringBuilder("SELECT AUTORITES.BACON_PROVIDER_035_JSON(");
request.append(provider);
request.append(") as data_xml from DUAL");
return baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
String result = baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
long endTime = System.nanoTime();
// Temps d'exécution en secondes
double duration = (endTime - startTime) / 1_000_000_000.0;
System.out.println("Temps d'exécution : BACON_PROVIDER_035_JSON(" + provider + ")" + duration + " secondes");
return result;
}

@ColumnTransformer(read = "XMLSERIALIZE (CONTENT data_xml as CLOB)", write = "NULLSAFE_XMLTYPE(?)")
public String doiToPpn(String doi) throws SQLRecoverableException, UncategorizedSQLException {
long startTime = System.nanoTime();
StringBuilder request = new StringBuilder("select XMLTRANSFORM(XMLROOT(XMLElement(\"sudoc\",AUTORITES.DOI2PNN('");
request.append(doi);
request.append("')),version '1.0\" encoding=\"UTF-8'),lexsl) from xsl_html where idxsl='JSON'");
return baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
String result = baseXmlJdbcTemplate.queryForObject(request.toString(), String.class);
long endTime = System.nanoTime();
// Temps d'exécution en secondes
double duration = (endTime - startTime) / 1_000_000_000.0;
System.out.println("Temps d'exécution : DOI2PNN(" + doi + ")" + duration + " secondes");
return result;
}
}

0 comments on commit 85f077c

Please sign in to comment.