Nesta apresentação venceremos os obstáculos comuns para iniciar o desenvolvimento em Java usando corretamente o MySQL como banco de dados. O MySQL é o banco de dados open source mais popular do mundo, usado em grandes sites como Facebook, Youtube, Twitter, Yahoo, Globo.com etc. Abordaremos tópicos como: baixar e instalar um servidor MySQL para desenvolvimento, preparar o banco de dados para uso com JDBC, escrever e testar seus primeiros programas Java com MySQL e funcionalidades específicas do driver Connector/J para um desenvolvimento e implantação mais eficiente.
Storing data is a basic and very common need in mobile apps. The Android application framework provides several storage options, one of which is SQLite databases.
In this tutorial you will see a simple Android database example. The example is based on the Android ListView Tutorial and the Android AsyncTask Tutorial, however these tutorials are not mandatory for the purpose of understanding the principles of proper Android database usage.
Storing data is a basic and very common need in mobile apps. The Android application framework provides several storage options, one of which is SQLite databases.
In this tutorial you will see a simple Android database example. The example is based on the Android ListView Tutorial and the Android AsyncTask Tutorial, however these tutorials are not mandatory for the purpose of understanding the principles of proper Android database usage.
В докладе речь пойдет о внедрении WebSockets в масштабный проект: ~ 400 типов сущностей, высокая плотность информации (> 10K items on dashboard), и высокие требования к актуальности данных. Стек проекта: PHP, Laravel, MySQL, Redis, Beanstalkd, Ractivejs.
Whether you’re an experienced Android developer, or you’re just getting started, you will need to think about storing data on the device. Android offers several options including relational data storage on a SQLite Database, but the APIs and examples provided by Google look like the state-of-the-art JDBC programming you did back in 1995! In this talk, you’ll learn how to use RealmDB, an elegant Object Relational database alternative to SQLite, to make database development on Android fun, easy, and testable.
This is my small sample to know how to save data in SQLite database on android Apps.
I write this with direct sample code. i hope it can understandable
BITS: Introduction to MySQL - Introduction and InstallationBITS
BITS: Introduction to relational databases and MySQL - Module 1: Introduction and Installation
See
http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
Confirurando Dababase Development no Eclipse LunaGeorge Mendonça
Configuring Database Development or no Moon to Eclipse Trabalhar com bank craps MySQL.
Configurando o Database Development no Eclipse Luna para trabalhar com banco de dados MySQL.
Slides para aula de como acessar bancos de dados em Java usando JDBC.
A apresentação é curta, mas inclui as principais informações sobre a API JDBC (DataSource, Connection, Statement, PreparedStatement) e exemplos de código para explanação.
O código-fonte de exemplo está disponível no GitHub: https://github.com/utluiz/jdbc-example
Material para todos los que trabajan en la iniciación y formación de jugadores infantiles y menores. La formación de jugadores es lo mas importante por sobre todo.
В докладе речь пойдет о внедрении WebSockets в масштабный проект: ~ 400 типов сущностей, высокая плотность информации (> 10K items on dashboard), и высокие требования к актуальности данных. Стек проекта: PHP, Laravel, MySQL, Redis, Beanstalkd, Ractivejs.
Whether you’re an experienced Android developer, or you’re just getting started, you will need to think about storing data on the device. Android offers several options including relational data storage on a SQLite Database, but the APIs and examples provided by Google look like the state-of-the-art JDBC programming you did back in 1995! In this talk, you’ll learn how to use RealmDB, an elegant Object Relational database alternative to SQLite, to make database development on Android fun, easy, and testable.
This is my small sample to know how to save data in SQLite database on android Apps.
I write this with direct sample code. i hope it can understandable
BITS: Introduction to MySQL - Introduction and InstallationBITS
BITS: Introduction to relational databases and MySQL - Module 1: Introduction and Installation
See
http://www.bits.vib.be/index.php?option=com_content&view=article&id=17204047:green-basics-of-databases&catid=81:training-pages&Itemid=190
Confirurando Dababase Development no Eclipse LunaGeorge Mendonça
Configuring Database Development or no Moon to Eclipse Trabalhar com bank craps MySQL.
Configurando o Database Development no Eclipse Luna para trabalhar com banco de dados MySQL.
Slides para aula de como acessar bancos de dados em Java usando JDBC.
A apresentação é curta, mas inclui as principais informações sobre a API JDBC (DataSource, Connection, Statement, PreparedStatement) e exemplos de código para explanação.
O código-fonte de exemplo está disponível no GitHub: https://github.com/utluiz/jdbc-example
Material para todos los que trabajan en la iniciación y formación de jugadores infantiles y menores. La formación de jugadores es lo mas importante por sobre todo.
An outline on why the MySQL 8 release is viewed as a gamechanger with a look at some of the new features like CTEs, Window Functions, MySQL InnoDB Cluster, Enterprise Data Masking, and more
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
This slide was presented at Mysql User Camp Event on 20-June-14 at Oracle bangalore. This presentation gives a good insight about New Features in Mysql 5.7 DMR 4 and Nosql Support in Mysql.
* Use cases of MySQL as well as edge cases of MySQL topologies using real-life examples and "war" stories
* How scalability and proxy wars make MySQL topologies more robust to serve webscale shops
* Open-source tools, utilities, and surrounding MySQL Ecosystem.
MySQL como Document Store PHP Conference 2017MySQL Brasil
Conheça uma nova forma schemaless de usar o MySQL e ganhe produtividade e flexibilidade ao trabalhar diretamente com documentos JSON, chave-valor ou híbrido NoSQL e SQL.
Entenda como Uber, Tesla Motors e Paypal usam MySQL como componente crítico da infraestrutura de dados. Falaremos de aspectos como:
- Alta Disponibilidade;
- Escalabilidade; e
- Schemaless.
Alta disponibilidade com MySQL EnterpriseMySQL Brasil
Nesta apresentação abordamos:
1. Alta disponibilidade (HA) – conceitos básicos
2. Arquiteturas e topologias de HA para MySQL
3. Monitoramento e gerenciamento
Uma visão do caminho que o MySQL está seguindo em sua evolução, apresentando funcionalidades NoSQL (Document Store), replicação ativo-ativo para InnoDB, escalabilidade horizontal de leitura e escrita, ideal para ambientes Cloud.
O MySQL agora pode ser usado como um NoSQL document store, combinando a flexibilidade do modelo de armazenamento de documentos com o poder do modelo relacional. A partir da versão 5.7 foram adicionados tipo de dados nativo JSON, colunas virtuais com indexação e muitas novas funções para manipulação de JSON. Mas agora há também um novo protocolo e API para tornar a vida do desenvolvedor ainda mais fácil. Com estas novidades o arquiteto deixará de ser forçado a escolher entre muitos trade-offs importantes quando estiver selecionando soluções NoSQL ou SQL. Nesta palestra daremos uma visão geral das novidades com alguns exemplos e casos de uso.
Enabling digital transformation with MySQLMySQL Brasil
Slides da apresentação no Oracle Open World 2016 em São Paulo.
Diversos setores da economia vêm passando por uma disruptura e estão sendo reinventados pela transformação digital. A tecnologia digital muda rapidamente e cria desafios e oportunidades sem precedentes para os executivos de TI. Nesta sessão, você entenderá por que transformação digital é o foco da agenda dos CIOs, assim como segurança, serviços na nuvem, big data e controle de custos. Saberá também como MySQL viabiliza a transformação digital, ajudando os executivos de TI a atingir seus objetivos.
Alta Disponibilidade no MySQL 5.7 para aplicações em PHPMySQL Brasil
A nova versão do MySQL traz muitas melhorias, principalmente nos recursos de alta-disponibilidade. Nesta palestra abordamos:
- opções para implementar alta disponibilidade no MySQL 5.7;
- topologias e arquiteturas de referência;
- boas práticas de monitoramento e gerenciamento.
A nova versão do MySQL traz muitas melhorias, principalmente nos recursos de alta-disponibilidade. Nesta palestra abordamos:
- opções para implementar alta disponibilidade no MySQL 5.7;
- topologias e arquiteturas de referência;
- boas práticas de gerenciamento.
Entenda como o MySQL é parte fundamental do OpenStack e perceba a excelente oportunidade de usar o MySQL como Serviço (DBaaS) numa cloud privada ou pública com API padronizada.
O MySQL é o banco de dados open source mais popular do mundo, usado em grandes websites como Facebook, Youtube, Twitter, Globo.com e também em aplicações mobile e embarcadas. Um fato que surpreende é que estes grandes websites desde seus primórdios se apoiam no MySQL como principal tecnologia de armazenamento de dados. No Vale do Silício (EUA), o MySQL continua forte e crescendo em popularidade. Nesta palestra destacaremos os principais motivos que levam as Start Ups Web a utilizar o MySQL, além de apresentar um guia prático de como começar a desenvolver com MySQL.
Novidades do MySQL para desenvolvedores ago15MySQL Brasil
Esta apresentação é sobre as principais novidades do MySQL 5.7 que os desenvolvedores precisam conhecer. Também há alguns comentários sobre MySQL Cluster 7.4, MySQL Fabric etc.
Estratégias de Segurança e Gerenciamento para MySQLMySQL Brasil
43% das empresas passaram por uma violação de dados em 2014, segundo o Ponemon Institute. Neste evento abordaremos os erros comuns que você pode estar cometendo, expondo seus dados a um risco desencessário e como minimizar brechas de segurança no MySQL. Falaremos também do ambiente ideal, altamente automatizado e gerenciado com apoio de ferramentas do MySQL Enterprise Edition.
Os engenheiros da Oracle andam ocupados: o MySQL 5.7 já está em estágio de Release Candidate e muitas novidades. Nesta apresentação abordaremos as novidades desta versão e também algumas melhorias do MySQL Cluster, detalhando os novos recursos como: interfaces NoSQL, Memcached API, JSON e HTTP, mais operações online, melhorias de desempenho no InnoDB e Otimizador, replicação multi-source entre outras.
Serviços Escaláveis e de Alta Performance com MySQL e JavaMySQL Brasil
As necessidades cada vez maiores de escalabilidade e performance nas aplicações Web e Mobile exigem novas estratégias no uso de bancos de dados, como por exemplo novos métodos de acesso NoSQL para MySQL. Tais métodos foram implementados recentemente e incluem APIs Java e Memcached que são uma alternativa de alto desempenho e escalável para consultas simples e que não requerem a definição de um esquema de dados rígido, mas também permitem aproveitar todas as vantagens já conhecidas de bancos de dados relacionais existentes.
Nesta apresentação mostraremos os novos métodos de acesso NoSQL para MySQL Server com InnoDB e MySQL Cluster e alguns casos de uso em arquiteturas Web e Mobile.
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...MySQL Brasil
Nesta apresentação damos uma visão geral dos recursos avançados do MySQL Enterprise Edition para aumentar os níveis de segurança, desempenho e disponibilidade do MySQL. Tópicos abordados:
• Investimentos da Oracle no MySQL
• Desempenho, escalabilidade, análise de consultas e tuning
• Backup/recuperação
• Segurança e auditoria
• Gerenciamento e Monitoramento do MySQL
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
5. Resumo: onde o MySQL se encaixa
• Novas aplicações e aplicações customizadas Ad-hoc
• principalmente arquitetura Web (ex. Linux+Apache+MySQL+Java)
• arquiteturas inovadoras, NoSQL (versão 5.6 e Cluster 7.2)
• Aplicações híbridas
• expansão de sistemas legados
• MySQL como front-end e Oracle DB como back-end
• Online e SaaS
• E-commerce/OLTP e pagamentos digitais
• Gerenciamento de Conteúdo (CMS)
• Redes Sociais, mensagens e colaboração
• Games Sociais e MMO
• Gerenciamento de Sessão e Autenticação do usuário
• Datamarts e Relatórios Departamentais
• SMS, e-marketing, Infra Telecom, Infra TI
• Embarcadas
5
6. MySQL em Aplicações Enterprise
Aplicações Corporativas de Missão Crítica
Importancia/Complexidade
Finanças Globais, ERP, SCM, CRM, HR
Aplicações Críticas para o Negócio
Impacto no negócio, Interdepartamentais
Aplicações Operacionais
De suporte, Departamentais
Corporativo Departamental
6
8. Portfolio Open Source (GPL)
• MySQL Database (Community Server) 5.5.27 GA e 5.6.6 DMR
• MySQL Cluster (NDB Community) 7.2.7 GA
• MySQL Workbench Community Edition 5.2.40 GA
• MySQL Utilities (em Python)
• MySQL Connectors
• ODBC, Java, .Net, C, C++, PHP, OpenOffice
• MySQL Proxy 0.8.2 Alpha
• Documentação: livre para uso, não coberto pela GPL
• Forums
dev.mysql.com/downloads
8
9. MySQL Enterprise Edition.
Indicado para empresas ou pessoas físicas que pretendem
aumentar produtividade, diminuir riscos e explorar mais
a fundo e aumentar as capacidades do MySQL.
Oracle Premier
Lifetime Support
MySQL Enterprise Oracle Product
Security Certifications/Integrations
MySQL Enterprise MySQL Enterprise
Audit Monitor/Query Analyzer
MySQL Enterprise MySQL Enterprise
Scalability Backup
MySQL Enterprise
MySQL Workbench
High Availability
11. MySQL Database
Performance, Confiabilidade, Facilidade de Uso
Gerenciamento
Suporte às mais
eficiente e multi-
conhecidas
thread de sessões
plataformas/linguagens
de desenvolvimento
Parsing completo
DML+DDL,
otimizador,
baseado em custo,
caching de queries
e resultados
Várias opções de
Storage Engine
para necessidades
específicas das
aplicações
Opções flexíveis de
logging e
armazenamento
físico
12. InnoDB no MySQL
- Storage Engine mais utilizado
- aplicações Web 2.0
- aplicações de varejo
- aplicações de entretenimento & mídia
- ACID, transacional
- Crash recovery
- Integridade referencial
- Suporta altos níveis de usuários concorrentes
- No MySQL versão 5.5
- padrão
- otimizado para hardware multi-core, multi-thread e SOs
14. MySQL Installer for Windows
• Interface gráfica nativa do
Windows
• Todos produtos MySQL para
desenvolvimento em UM único
pacote
• MySQL Database
• MySQL Connectors
• MySQL Workbench e exemplos de
modelos
• Exemplos de bancos de dados
• Documentação
• Alta integração de produtos,
download sob demanda,
funcionalidades de atualização
15. MySQL Installer for Windows
Selecione
Atualize
Configure
mysql.com/downloads
16.
17. No Linux ou Mac, prefira os binários
mysql.com/downloads/mysql
18. Tutorial MySQL em 10 minutos
slideshare.net/MySQLBR/mysql-em-10min-alexandre-almeida-hti-tecnologia
19. No Linux ou Mac, instale também o
Connector/J
mysql.com/downloads/connector/j
22. Teste via MySQL Client
(opcional)
C:Program FilesMySQLMySQL Server 5.5bin>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 8
Server version: 5.5.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input
statement.
mysql>
26. Parar ou Iniciar o servidor MySQL
(opcional)
Ou via MySQL Notifier
27. Tudo certo com seu ambiente Java? 1/2
Instalar e configurar JDK e path
oracle.com/technetwork/java/javase/downloads
28. Tudo certo com seu ambiente Java? 2/2
JDK e path configurados
C:Program FilesMySQLMySQL Server 5.5bin>java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
C:Program FilesMySQLMySQL Server 5.5bin>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging inf
...o
30. Adicione o driver MySQL ao CLASSPATH
caminho completo do .jar
Confira:
C:>set CLASSPATH
CLASSPATH=.;C:Program Files (x86)Javajre6libextQTJava.zip;C:Program Files
MySQLmysql-connector-java-5.1.22mysql-connector-java-5.1.22-bin.jar
31. HelloMysql.java 1/2
import java.sql.*;
public class HelloMysql {
public static void main(String args[]){
System.out.println("Tentando conectar ao MySQL...");
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/mysql";
String usuario = "root";
String senha = "root";
Connection con = DriverManager.getConnection(url, usuario, senha);
System.out.println("URL: " + url);
System.out.println("Connection: " + con);
Continua…
32. HelloMysql.java 2/2
Statement stmt = con.createStatement(); //objeto Statement
ResultSet rs; //objeto ResultSet
rs = stmt.executeQuery("SELECT * FROM world.country");
System.out.println("Ola mundo!");
while(rs.next()){
String nomePais = rs.getString("Name");
System.out.print(nomePais + ", ");
}//end while
con.close();
} catch( Exception e ) {
e.printStackTrace();
}//end catch
}//end main
}//end class HelloMysql
FIM!
33. java HelloMysql
C:tutorial>javac HelloMysql.java
C:tutorial>java HelloMysql
Tentando conectar ao MySQL...
URL: jdbc:mysql://localhost:3306/mysql
Connection: com.mysql.jdbc.JDBC4Connection@ed07f45
Ola mundo!
Aruba, Afghanistan, Angola, Anguilla, Albania, Andorra, Netherlands Antilles, Un
ited Arab Emirates, Argentina, Armenia, American Samoa, Antarctica, French South
ern territories, Antigua and Barbuda, Australia, Austria, Azerbaijan, Burundi, B
elgium, Benin, Burkina Faso, Bangladesh, Bulgaria, Bahrain, Bahamas, Bosnia and
Herzegovina, Belarus, Belize, Bermuda, Bolivia, Brazil, Barbados, Brunei, Bhutan
, Bouvet Island, Botswana, Central African Republic, Canada, Cocos (Keeling) Isl
ands, Switzerland, Chile, China, Côte d’Ivoire, Cameroon, Congo, The Democrati
c Republic of the, Congo, Cook Islands, Colombia, Comoros, Cape Verde, Costa Ric
a, Cuba, Christmas Island, Cayman Islands, Cyprus, Czech Republic, Germany, Djib
…
ietnam, Vanuatu, Wallis and Futuna, Samoa, Yemen, Yugoslavia, South Africa, Zamb
ia, Zimbabwe,
35. Revisão: conectando o Java ao MySQL
• O driver JDBC é chamado MySQL Connector/J
• Desenvolvido pela Oracle sob licença GPL
• Driver Type IV (todo java, nativo)
• Disponível para baixar em:
• Software
• dev.mysql.com/downloads/connector/j
• Maven, Ivy
• Many Linux and BSD distributions
• Documentation
• dev.mysql.com/doc/refman/5.5/en/connector-j.html
35
36. Revisão: Entendendo o CLASPATH
• O classpath é o local onde o Java procura por código
compilado (biblioteca)
• Há locais padrão para o classpath
• WEB-INF/lib, WEB-INF/classes in webapps
• $JRE_HOME/lib/ext
• Quando estiver desenvolvendo ou implantando evite
estes locais
• $JRE_HOME/lib/ext
• Application-server-wide
• e.g. $CATALINA_HOME/lib
• Se possível deixe este trabalho para sua IDE
36
42. Arquitetando para o Sucesso
Comece limpo
Presentation
Business Logic
Persistence
42
43. Arquitetando para o Sucesso
Comece limpo
Presentation
Transactions
Business Logic
Persistence
43
44. Arquitetando para o Sucesso
Comece limpo
Presentation
Transactions
Business Logic
Caching
Persistence
44
45. Arquitetando para o Sucesso
Comece limpo
Presentation } Test this
Transactions
Business Logic } Test this
Caching
Persistence } Test this
45
46. Arquitetando para o Sucesso
Use ferramentas adequadas
• Using Maven to manage the depedencies/build
• Using SpringFramework
• Dependency Injection
• Templates/Boilerplate/Integration
• Uma boa IDE: NetBeans, Eclipse
46
47. Arquitetura em Camadas
Exemplo Criar Usuário
@Override
public User createUser(String login, String firstName, String lastName, String credentials) {
jdbcTemplate.update("INSERT INTO user (login, first_name, last_name, passwd_hash)
VALUES (?, ?, ?, ?)", login, firstName, lastName, credentials);
long id = jdbcTemplate.queryForLong("SELECT LAST_INSERT_ID()");
PersistentUser user = new PersistentUser();
user.setId(id);
user.setLogin(login);
user.setFirstName(firstName);
user.setLastName(lastName);
user.setCredentials(credentials);
return user;
}
47
48. Como era no Raw JDBC
public User createUser(Connection c, String } catch (SQLException sqlEx) {
login, String firstName, String lastName, String
// handle it, it's not a concern outside
credentials) {
of persistence
PreparedStatement p = null; } finally {
try { try {
p = c.prepareStatement("INSERT
if (p != null) { p.close(); };
INTO user (login, first_name, last_name,
passwd_hash) VALUES (?, ?, ?, ?)"); } catch (SQLException sqlEx) {
p.setString(1, login); // can't do anything here, log?
p.setString(2, firstName); }
ResultSet rs = }
p.getGeneratedKeys(); }
rs.next();
long id = rs.getLong(1);
PersistentUser user = new
PersistentUser(); Estes tipos de
user.setId(id); acesso é conhecido
return user;
como Raw JDBC…
48
50. Class not found
• java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver
• The driver is not in your CLASSPATH
• Standalone applications with framework-managed
CLASSPATH help with this, i.e WEB-INF/lib, or mvn or ant-
managed CLASSPATH
66
51. No Suitable Driver
• SQLException: No suitable driver
• Check your URL, compare to the documentation at
http://dev.mysql.com/doc/refman/5.1/en/connector-j.html
• Your URL should look something like
jdbc:mysql://host:port/database[...]
67
52. Out of Memory
• java.lang.OutOfMemoryError when reading results
• Your result set is too large, Connector/J buffers results by
default
• Most use cases don’t require large result sets
• Those that do, process in chunks via SELECT ... LIMIT, or
Statement.setFetchSize(Integer.MIN_VALUE)
• Heap dump shows many statement, result set
instances
• Not closing resources on every code path
• Frameworks help prevent this
• Plumb try {} catch {} finally {} throughout your code (yuck!)
68
53. Communications Exceptions
• "The last packet sent successfully to the server was 0
milliseconds ago. The driver has not received any packets
from the server."
• Your server was started with --skip-networking or --bind-
address=127.0.0.1 and your client is remote to the server
• “The last packet successfully received from the server was
25899 milliseconds ago.The last packet sent successfully to
the server was 25899 milliseconds ago, which is longer than
the server configured value of 'wait_timeout'”
• Connections are sitting idle too long in your pool
• Configure your pool to evict idle connections before
wait_timeout would expire
• Don’t let connections idle much more than the amount of
time it takes to create a new one under worst-case
69
55. MySQL Migration Tool Novo!
• Wizard para migração de tabelas e dados:
• MS-SQL Server 2000, 2005, 2008 e 2012.
• SGBDs em geral via ODBC
• Mapeamento personalizado (opcional)
• Integrado ao Workbench open source e gratuito
Download:
mysql.com/downloads
Documentação:
dev.mysql.com/doc/workbench/en/wb-migration.html
71
58. Referências
• Use MySQL with Java
http://dev.mysql.com/usingmysql/java/
• Read Connector/J User Manual
http://dev.mysql.com/doc/refman/5.5/en/connector-j.html
• Download MySQL 5.5
http://www.mysql.com/downloads/mysql/
• Download Free MySQL White Papers
http://dev.mysql.com/why-mysql/white-papers/
• View MySQL Training Courses
http://mysql.com/training
74
59. MySQL Treinamento e Certificação
Treinamentos
MySQL DBA MySQLDeveloper Certificações
MySQL Boot Camp MySQL Boot Camp
Accelerated Accelerated
MySQL Performance MySQL Performance
Tuning Boot Camp Tuning Boot Camp
Accelerated Accelerated
MySQL for Begginers MySQL for Begginers
MySQL for Database MySQL and PHP
Administrators Developing Dynamic
Web Applicationg
MySQL Performance
Tuning MySQL for Developers
MySQL High MySQL Advanced
Availability Stored Procedures
MySQL Cluster
Opcional
Necessário
education.oracle.com
75