Home
Insert Picture Here
Contents
1. MySQL Developer Essentials with PHP Java and NET Ralf Gebhardt Principal Sales Engineer Agenda MySQL Overview Development Basics Java e PHP e NET Resources and Q amp A ORACLE About MySQL e 15 years of development Acquired by Sun in February 2008 Acquired by Oracle in January 2010 1 Most popular Open Source Database Low Cost Easy to Use Performance Reliability and Scalability ORACLE E Oracle s Plans for MySQL Fill In Oracle s database product suite MySQL Global Business Unit Invest in MySQL Make MySQL a Better MySQL Develop promote and support MySQL MySQL Community Edition Source and binary releases GPL license ORACLE MySQL Architecture m r Connectors Native C API JDBC ODBC NET PHP Python Perl Ruby VB MySQL Server Connection Pool Authentication Thread Reuse Connection Limits Check Memory Caches SQL Interface Parser Optimizer Caches amp Buffers DML DDL Query Translation Access Paths Global and Stored Procedures Object Privilege Statistics Engine Specific Views Triggers etc Caches amp Buffers lt w Pluggable Storage Engines Memory Index amp Storage Management ioe da ca cd G4 28 90 308 aa InnoDB MyISAM Cluster Archive Merge Memory Partner Community Custom File System Files amp Logs NTFS NFS Redo Undo Data Index Binary SAN NAS Error Query
2. at the sole discretion of Oracle ORACLE Hardware and Software Engineered to Work Together We encourage you to use the newly minted corporate tagline Hardware and Software Engineered to Work Together at the end of all your presentations This message should replace any reference to our previous corporate tagline Software Hardware Complete ORACLE
3. allows you bo change the way Py sob Connector Met 6 3 4 Features are installed on your computer or to remove iE From your computer Click Next bo continue or Lore Components Core Components Cancel to exit the Setup Wizard Entity Framework Support Documentation Web Providers Compact Framework Support This Feature requires UKP on your Visual Studio Integration hard drive Samples Ea Sharp E Visual Basic ORACLE E Installing Connector NET Mono e There is no installer available for installing the Connector NET component on your Unix installation Before installing please ensure that you have a working Mono project installation You can test whether your system has Mono installed by typing shell mono version The version of the Mono JIT compiler will be displayed To compile C source code you will also need to make sure a Mono C compiler is installed ORACLE IN Installing Connector NET Mono cont To install Connector NET on Unix Mono Download the mysql connector net version noinstall zip and extract the contents to a directory of your choice for example connector net n the directory where you unzipped the connector to change Into the bin directory Ensure the file MySql Data dll is present You must register the Connector NET component MySgl Data in the Global Assembly Cache GAC In the current directory enter the gacutil command e root shell g
4. and Slow ORACLE E MySQL Connectors python EN ext Microsoft Connector ODBC Connector Net Connector C Native Driver for PHP Connector J Connector MXJ Cluster J Cluster JPA S ORACLE E Web Application Primer Focus on the business logic e Clean separation of presentation business logic persistence See also MVC Model View Controller Architecture e Find and use the appropriate framework Don t reinvent the wheel Look for the framework to provide anything non business related Beware if you start refactoring or worse cut and pasting application plumbing ORACLE E Architecting for Success Start Clean Presentation Business Logic Persistence ORACLE E Architecting for Success Start Clean Presentation Persistence Transactions ORACLE E Architecting for Success Start Clean Presentation t Test this Persistence t Test this Transactions ORACLE E Interacting with the database e Keep DB related code together ideally in the framework Helps performance tuning e Leverage new features simplify configuration Helps portability e You don t want to track down vendor specific keywords in 1000s of files e Start vendor neutral vanilla SQL add vendor specific code as you weigh it s worth ORACLE Connecting Java to MySQL The JDBC
5. driver is called MySQL Connector J Type IV all java Avallable from the following sources Software http dev mysal com downloads connector j 5 1 html Maven Ivy Ant amp Spring are all projects you should get familiar with Many Linux and BSD distributions and Solaris all have Oracle Java software including Connector J available in their repositories Documentation http dev mysql com doc refman S 1 en connector j htm ORACLE More Java Resources e Use MySQL with Java http dev mysal com usingmysal java Read Connector J User Manual http dev mysql com doc refman 5 5 en connector j html Visit MySQL JDBC and Java Forum http forums mysql com list php 39 ORACLE Leveraging the Frameworks Don t use raw JDBC An example with the Spring framework and Java annotations AOverride public User createUser String login String firstName String lastName String credentials Jas clases oasis Saa ING Use Losa lies e ee Jessi ase pels se nes aa 2 2 login firstName lastName credentials Long Le Jcebetenplare cue Moca C SEED Ie SE JONES dedo ll PersistentUser user new PersistentUser user setId id See 5 serlo sua losa user setFirstName firstName user setLastName lastName user setCredentials credentials reellen seis ORACLE Versus raw JDBC public User createUser Connection c String login String firstNa
6. c Sen sees using MySql Data MySqlClient SUELOS Oui setvel lLocal ost y USSR OO y Cla tela se test y 892 2208 Pa gWoxgoe te pu MySqlConnection conn new MySqlConnection connStr MySsqlBulkLoader bl new MySqlBulkLoader conn bl TableName Career bl lie lernen Wr SL Limeitenmiimacorm as bl FileName c career data txt bl NumberOfLinesToSkip 3 ORACLE E Uploading E Console WriteLine Connecting to MySOL conn Open Upload data from file int count bl Load Console WriteLine count lines uploaded catch Exception ex Console WriteLine ex ToString ORACLE Resources Upcoming MySQL live Webinar http www mysal com news and events web seminars index html MySQL on demand Webinars http www mysql com news and events on demand webinars MySQL Whitepapers http www mysal com why mysal white papers MySQL Case Studies http www mysql com why mysql case studies e Get in Touch http mysql com contact ORACLE The preceding is intended to outline our general product direction It is intended for information purposes only and may not be incorporated into any contract It is not a commitment to deliver any material code or functionality and should not be relied upon in making purchasing decisions The development release and timing of any features or functionality described for Oracle s products remains
7. e in the properties window he correct DDL is then generated and the developer can then save this code as a mysal file in their project and execute it against the MySQL server ORACLE E Integrating Connector NET with Visual Studio cont New SQL Editor A new SQL editor has been included that enables connections to servers to execute SQL This is activated by creating a new file with a mysql extension A new template is also included to allow creation of this file type using the Visual Studio 2010 main menu item FILE NEW Note the MySQL SQL Editor is also available in 2005 and 2008 ORACLE E NET Options for MySQL Similar to Connector J Connector NET has many extensions to the NET API to enhance MySQL usage Full listing is here http dev mysql com doc refman 5 5 en connector net connection options html They include eame HA Cluster options as Connector J Using Windows Named Pipes in place of TCPIP Connection pooling in the driver Compression encryption caching options as well ORACLE Bulk loading with Connector NET You can now process text file loads similar to the MySQL LOAD DATA INFILE statement Assume the following file Table Career in Test Database Name Age Profession Tony 47 Technical Writer Ana 43 Nurse Fred 21 IT Specialist Simon 45 Hairy Biker And a corresponding Careers table in MySQL ORACLE Bulk loading setup code Sa
8. me String lastName String credentials PreparedStatement p null try 1 C prepareStatement INSERT INTO user login idee Se eto leiste mettle exe neuere sia IMPER RIS a pps Eo sm Jor Ste See have 27 SNE mes e ResultSet rs p getGeneratedKeys me SELLOS E PersistentUser user new PersistentUser user setld 1d return SS ed eearel SO ceo SO s 4 handle Lt a s NOt a concern outside of persistence THT Ika 4 Cy d if p null p close eei celn SOME ceo meds 4 can t do anything here log return null ORACLE Extensions HA and Clustering Add multiple hosts to the connect string for replication cluster awareness jdbc replication master slave1 slave2 slaveN Auto failover readonly for Master Slave Auto load balance among slaves for non DML Requires your code knows when to create RO vs RW statements jdbc mysql loadbalance node1 nodeN loadBalanceStrategy random Many more options ORACLE Class Not Found e java lang ClassNotFoundException com mysal jdbc Driver The driver is not in your CLASSPATH e Standalone applications with framework managed CLASSPATH help with this i e WEB INF lib or mvn or ant managed CLASSPATH ORACLE u No Suitable Driver e SQLException No suitable driver Check your URL compare to the documentation at http dev mysql com doc refman 5 1 en connecto
9. nsistent interface for accessing databases in PHP http php net intro pdo Lowest common denominator PHPish API PDO is emulating prepared statements by default pdo setOption PDO MYSQL ATTR DIRECT QUERY false ORACLE E Reasons for using different APIs e mysql e PDO Support for all MySQL features Simple applications supporting Best support stability multiple databases for instance Oracle DB and MySQL Integration with existing applications environments Integration with existing applications environments ORACLE Escaping for mysgli e mysqli real escape string Escapes special characters for usage in SQL statements Takes current encoding into account Prevents SQL injection Ssql sprintf INSERT INTO employees leida deste les meme last name GCSE VELUES eS sy Ss 2 weg real escape Siig coma IOS wes zeal o A ON a escape o IOS loses Cara Eier diee Jj asi meme 1 Y gt A A A zz zT pns MySCla ceel ee SC ng cona ge are ae an LE d d quegli cpecy 9oomm Seul 4 ERROR ORACLE E Prepared Statements and mysqli query INSERT INTO employees are meme last nene genderc ACUT Om RE RII E 9S aec goeepsce i o coonma POUeSy eg sume sme Baran Ssume sse well Swalz Swals Svel4 5 swall Johanness E a gt Svals MM MSC Scie Sxecuies SSicwme 5 Svall Andrey Syalz2 Juseuo
10. r j html Your URL should look something like Jdbe mysal host port database ORACLE E Out of Memory java lang OutOfMemoryError when reading results Your result set is too large Connector J buffers results by default Most use cases dont require large result sets Those that do process in chunks via SELECT LIMIT or otatement 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 ORACLE u Introduction to PHP PHP Hypertext Preprocessor The most common P in LAMP Web Centric Scripting Language Processed by a Web Server module Can be embedded in HTML Built in functionality for dealing with Web Things Developed by a large Open Source community since 1995 Multiple Oracle employees actively involved PHP consists out of a relatively small core and a large collection of function libraries extensions ORACLE E PHP and MySQL Resources e Use MySQL with PHP http dev mysql com usingmysql php e Read Connector PHP User Manual http dev mysql com doc refman 5 1 en apis php html ORACLE Verifying the PHP Installation sion 5 3 4 dewv p SUNOS guybrush 5 11 sr 1437 i amp epc Aug 27 2010 14 02 52 sf f fsrc php php src branches FPHrP 5 3f configu
11. re enable with miyvsqgil mysqind with mysgqlii mysqind with pdo myvsql mysgqind with lib vitlhi bzz with apxes2 usry 2 2fbin apxs prefix opt php 5 3 debug notsrrm qcc enal with xsl Apache 2 0 Handler tory disabled n File fopt php ss 3 debugqg notsrm qcc lib h fopt php s 3 debugqg notsrm gqcc libs php ini m File for none ail TM TIT Client API library version mysalnd 5 0 7 dew 091210 Revision 296270 Active Links c xampp htdocsitest php lt php ohpinfo 7 gt http localhost test php ORACLE E PHP Extensions for MySQL PDO mysql ORACLE E ext mysgl One of the first PHP extensions Actively maintained with PHP 4 No new features in PHP 5 Exception Added mysalnd support with PHP 5 3 Bug fixing only Best documented database extension Tons of books tutorials Missing support for many MySQL features New Authentication protocol Prepared statements Queries with multiple result sets stored procedures compression encryption full charset support ORACLE mysqli The Improved MySQL Extension Full support for all MySQL features Stored Procedures Prepared Statements Encryption SSL Compression Charsets Actively developed maintained and supported by Oracle ORACLE E PDO mysqli The PHP Data Objects PDO extension defines a lightweight co
12. t gacutil i MySql Data dli This will register MySql Data into the GAC You can check this by listing the contents of usr lib mono gac where you will find MySql Data if the registration has been successful ORACLE E Integrating Connector NET with Visual Studio e MySQL Connector NET supports Visual Studio versions 2005 2008 and 2010 However only MySQL Connector NET version 6 3 fully integrates with Visual Studio 2010 Visual Studio 2010 support was introduced with MySQL Connector NET 6 3 2 From version 6 3 2 the connector ships with both NET 2 x and NET 4 x versions of the Entity Framework support files mysql data ef dll and mysql visualstudio dll ORACLE E Integrating Connector NET with Visual Studio cont When MySQL Connector NET is installed on Microsoft Windows Visual Studio integration components are also installed and initialized This enables the developer to work seamlessly with MySQL Connector NET in the familiar Visual Studio environment ORACLE E Integrating Connector NET with Visual Studio cont he NET 4 x versions need to be shipped to enable new integration features supported in Visual Studio 2010 including New DDL T4 template for the Entity Framework EF Enables developers to design an EF model from scratch and use the native Visual Studio 2010 facility to generate MySQL DDL from that model This is done by creating the model and choosing the SSDLToMySQL templat
13. w gt Swalsa Wc mysgli SE execute eem s uses sume Close Ssicme y ORACLE PDO Basics pdo new PDO mysql host localhost dbname test user password Squery Spdo gt prepare SELECT id FROM table LIMIT Squery gt bindValue 1 GET offset PDO PARAM INT Squery gt bindValue 2 int GET limit Squery gt execute ORACLE Asynchronous Queries query Sconn new MySOLi Sconn gt query SELECT FROM t WHERE MYSQLI ASYNC result Do something query weg THT Terrors Seej ecr 1 poll result m i nn ORACLE E MySQL and Windows Embrace with Windows way Install Visual Studio extensions for MySQL Take advantage of MySQL Workbench Use MySQL 5 5 especially if MySQL is your server platform as well huge performance gains ORACLE E What You Need for Connector NET Development MySQL Database Installed and Running Connector NET Driver v6 3 2 or later for VS 2010 Visual Studio 2005 2008 2010 MySQL Workbench 5 2 optional ORACLE Installing Connector NET Windows iz MySQL Connector Net 6 3 4 Setup iz MySQL Connector Net 6 3 4 Setup Custom Setup Welcome to the MySQL Connector Met Select the way you want Features to be installed 6 3 4 Setup Wizard Click Ehe icons in the tree below ko change the way Features will be installed The Setup Wizard
Download Pdf Manuals
Related Search
Related Contents
Mode d'emploi pdf • TOSTIERA - MANUALE DI ISTRUZIONI • TOASTER - USE PTC-0120BA1 User Manual, Rev. A DRUCOMAT 3 Apparecchio per la pressofusione Lightolier IS:6487 User's Manual PROFOMETER® PM-6 MANUEL D`UTILISATION SM-9671 - Ansaldo STS Sony XS-A1025 User's Manual Copyright © All rights reserved.
Failed to retrieve file