Skip to content

Instantly share code, notes, and snippets.

View altitdb's full-sized avatar

Altieres de Matos altitdb

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@altitdb
altitdb / gist:775c987e58dcf858e7f2
Created June 23, 2015 15:23
Implementação da validação de XML com XSD
private void OutputJaxpImplementationInfo() {
System.out.println(getJaxpImplementationInfo("DocumentBuilderFactory", DocumentBuilderFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("XPathFactory", XPathFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("TransformerFactory", TransformerFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("SAXParserFactory", SAXParserFactory.newInstance().getClass()));
}
private String getJaxpImplementationInfo(String componentName, Class componentClass) {
CodeSource source = componentClass.getProtectionDomain().getCodeSource();
return MessageFormat.format(
@MySQL
Liberar acesso de outros hosts.
grant all on *.* to root@'%' identified by 'root';
@altitdb
altitdb / gist:3239717
Created August 2, 2012 18:56
m2eclipse
How do I Download m2eclipse?
Maven - http://download.eclipse.org/technology/m2e/releases
https://support.sonatype.com/entries/20914842.html?__utma=246996102.2011723869.1343932852.1343932852.1343933261.2&__utmb=246996102.8.10.1343933261&__utmc=246996102&__utmx=-&__utmz=246996102.1343933261.2.2.utmcsr=google|utmccn=%28organic%29|utmcmd=organic|utmctr=%28not%20provided%29&__utmv=-&__utmk=12338743
@Oracle
Atribuir privilégios de DBA para usuário.
GRANT DBA TO my_user;
@Oracle
Deletar usuário e objetos.
drop user my_user cascade;
@Oracle
Listar todos os usuários.
select * from dba_users;
@Oracle
Alterar senha usuário.
1.
alter user my_user identified by my_password;
2.
alter user my_user identified by values 'code_hash_generated_by_oracle';
@Oracle
Exportar/Importar database.
Export FULL:
exp my_user/my_password@my_database full=y file=name_my_dump.dmp
Import FULL:
imp my_user/my_password@my_database full=y file=name_my_dump.dmp
@Java
When you override the equals method, you must adhere to its general contract. Here
is the contract, copied from the specification for java.lang.Object:
The equals method implements an equivalence relation:
• It is reflexive: For any reference value x, x.equals(x) must return true.
• It is symmetric: For any reference values x and y, x.equals(y) must return true
if and only if y.equals(x) returns true.