Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Database Access With JDBC

contains good explanation on jdbc, connection pooling and connection pooling using c3p0, mysql database software

  • Login to see the comments

Database Access With JDBC

  1. 1. JDBC <br />
  2. 2. JDBC<br />Is an API spec. whose implementation comes in the form of jdbc drivers.<br />JDBC API :<br />java.sql.*<br />javax.sql.*<br />
  3. 3. JDBC Driver<br />Is a bridge s/w between java application and database s/w.<br />Is a java class that implements java.sql.Driver interface.<br />Why we use JDBC Driver?<br />
  4. 4. JDBC Architecture<br />Application<br />JDBC<br />Driver<br />Java code calls JDBC library<br />JDBC loads a driver<br />Driver talks to a particular database<br />Can have more than one driver -> more than one database<br />
  5. 5. JDBC Drivers<br />Type I: “Bridge”<br />Type II: “Native”<br />Type III: “Middleware”<br />Type IV: “Pure”<br />
  6. 6. Type 1 Driver (jdbc - odbc bridge driver )<br />Oracle<br />DB<br />Java App that uses JDBC API<br />Jdbc driver type1<br />ODBC Driver for Oracle<br />Vendor DB Library for Oracle<br />MS Access<br />ODBC Driver for MS-Access<br />Vendor DB Library for M S Access<br />
  7. 7. Type 1 Driver (Cont….)<br />Inbuilt driver of j2sdk s/w.<br />Suitable to interact with almost all the database s/w ’s<br />Driver performance is very poor.<br />Not suitable for internet programming and applet to database communication<br />
  8. 8. Type 2 Driver (Native API /Partly Java Driver)<br />Oracle<br />DB<br />Java App that uses JDBC API<br />Jdbc driver type2<br />Vendor DB Library for Oracle<br />MS Access<br />Vendor DB Library for M S Access<br />Jdbc driver type2<br />
  9. 9. Type 2 Driver (cont…)<br />Specific to each database s/w.<br />Significantly better performance than Type 1.<br />Odbc drivers presence is not mandatory.<br />Not suitable for large scale applications.<br />Not suitable for internet / applet programs<br />Every db requires a separate driver.<br />
  10. 10. Type 4 Driver (Native Protocol /All Java Driver)<br />Oracle<br />DB<br />Java App that uses JDBC API<br />Jdbc driver type4<br />MS Access<br />Jdbc driver type4<br />
  11. 11. Type 4 Driver (Native Protocol / All Java Driver)<br />Completely developed in java.<br />Can interact with db without having the support of odbc driver / vendor db library.<br />Platform independent.<br />Performance is good.<br />Applet and internet programming is possible<br />
  12. 12. Type 3 Driver ( Network Protocol Driver )<br />Java app manipulates DB data using con object<br />Java App<br />(Client App)<br />DB S/W<br />Interact using type 1,2,4 drivers<br />Gets object from conn pool using type 3<br />Application Server<br />JDBC CONNECTION POOL<br />Release connection object back to conn pool<br />con<br />con<br />con<br />Java App<br />(Client App)<br />con<br />
  13. 13. Type 3 Driver<br />Is not a driver<br />Its protocol<br />Contains rules required to establish communication between java application and connection pool<br />
  14. 14. JDBC Drivers (Fig.)<br />JDBC<br />Type I<br />“Bridge”<br />ODBC<br />ODBC<br />Driver<br />Type II<br />“Native”<br />CLI (.lib)<br />Middleware<br />Server<br />Type III<br />“Middleware”<br />Type IV<br />“Pure”<br />
  15. 15. Steps to develop java/jdbc App<br />java.sql<br />Classes<br />------------<br />Types<br />DriverManager<br />Date<br />TimeStamp<br />Interfaces <br />---------------<br />Connection<br />Statement<br />ResultSet<br />Driver<br />PreparedStatement<br />CallableStatement<br />
  16. 16. Steps to develop java/jdbc App<br />Load the JDBC Driver class and register with DriverManager.<br />Establish the connection with database s/w.<br />Prepare Statement object<br />Execute the query.<br />Get result and process the result<br />Close the connection.<br />
  17. 17. Loading & Registering a Driver<br />statically load driver<br />Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);<br />
  18. 18. DriverManager<br />All JDBC Drivers will be registered and managed by DriverManager.<br />When a driver class is first loaded, it registers itself with the DriverManager<br />Therefore, to register a driver, just load it!<br />
  19. 19. Connection<br />A Connection represents a session with a specific database.<br />Establishing connection with db s/w is nothing but creating communication channel<br />Can have multiple connections to a database<br />Once task with connection is completed, close the connection.<br />
  20. 20. Obtaining a Connection<br />String url = "jdbc:odbc:datasource";<br />try {<br />Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");<br /> Connection con = DriverManager.getConnection(url);<br />}<br />catch (ClassNotFoundException e) <br /> { e.printStackTrace(); }<br />catch (SQLException e)<br /> { e.printStackTrace(); }<br />
  21. 21. Statement<br />Acts as a courier service to send queries to the db s/w.<br />A Statement object is used for executing a static SQL statement and obtaining the results produced by it.<br />
  22. 22. Statement Methods<br />ResultSetexecuteQuery(String) <br />Execute a SQL statement that returns a single ResultSet. <br />intexecuteUpdate(String) <br />Execute a SQL INSERT, UPDATE or DELETE statement. Returns the number of rows changed.<br />boolean execute(String) <br />Execute a SQL statement that may return multiple results. <br />What is the difference between execute(-) and executeQuery(-)?<br />
  23. 23. ResultSet<br />A ResultSet object is a java object which can store bunch of selected rows given by select query execution.<br />Only one ResultSet per Statement can be open at once.<br />The table rows are retrieved in sequence.<br />A ResultSet maintains a cursor pointing to its current row of data. <br />The 'next' method moves the cursor to the next row. <br />
  24. 24. ResultSet<br />Cursor<br />BFR<br /> ALR<br />
  25. 25. ResultSet Methods<br />boolean next() <br />activates the next row<br />the first call to next() activates the first row<br />returns false if there are no more rows <br />void close() <br />disposes of the ResultSet<br />allows you to re-use the Statement that created it<br />
  26. 26. ResultSet Methods<br />TypegetType(intcolumnIndex)<br />returns the given field as the given type<br />fields indexed starting at 1 (not 0)<br />TypegetType(String columnName)<br />same, but uses name of field<br />less efficient<br />
  27. 27. ResultSet Methods<br />String getString(int columnIndex) <br />boolean getBoolean(int columnIndex) <br />byte getByte(int columnIndex) <br />short getShort(int columnIndex) <br />int getInt(int columnIndex) <br />long getLong(int columnIndex) <br />float getFloat(int columnIndex) <br />double getDouble(int columnIndex) <br />Date getDate(int columnIndex) <br />Time getTime(int columnIndex) <br />Timestamp getTimestamp(int columnIndex) <br />
  28. 28. JDBC Object Classes<br />DriverManager<br />Loads, chooses drivers<br />Driver<br />connects to actual database<br />Connection<br />a series of SQL statements to and from the DB<br />Statement<br />a single SQL statement<br />ResultSet<br />the records returned from a Statement<br />
  29. 29. JDBC Class Usage<br />DriverManager<br />Driver<br />Connection<br />Statement<br />ResultSet<br />
  30. 30. Types of Statement Objects<br />Statement Object<br />PreparedStatement Object<br />CallableStatement Object.<br />Operations performed by Database Engine :<br />Parse<br />Execute<br />Fetch<br />2) Parse<br />3) Execute<br />4) Fetch<br />DB Engine<br />Send sql query<br />Java <br />App<br />
  31. 31. Limitations of Statement Object<br />DB s/w parses the same query multiple no. of times and executes, fetches the o/p .<br />Framing query for simple Statement object using variable is quite unnecessary.<br />Network traffic to the DB s/w is heavy since same query goes multiple no. of times to the DB s/w.<br />To overcome these problems use precompiled queries.<br />
  32. 32. PreparedStament Object<br />A query that goes and resides on the DB s/w without values by becoming parsed query is a precompiled query.<br />Precompiled queries will be parsed only once, but capable of executing multiple times with same or different values.<br />PreparedStatement object represents this precompiled query.<br />When to use Statement object and PreparedStatement object ?<br />
  33. 33. Steps to work with PreparedStatement<br />Prepare the query having positional parameters.<br />String query=“insert into item values(?,?,?,?)”;<br />Positional parameter indicates value to that query will be set afterwards.<br />Create PreparedStatement object.<br />PreparedStatementps=con.prepareStatement(query);<br />Set the values for positional paremeters using setType(-,-) methods.<br />ps.setInt(-,-), ps.setString(-,-)<br />This method makes query as a precompiled query<br />
  34. 34. Steps to work with PreparedStatement<br />Execute the query<br />int result = ps.executeUpdate();<br />For more executions repeat step 3 & 4.<br />Close PreparedStatement object<br />ps.close()<br />
  35. 35. CallableStatement<br />DB s/w can maintain the business logic in the form of PL/SQL procedures and functions.<br />To call PL/SQL procedures and functions from the java app , use CallableStatement.<br />Procedure is a subprogram that performs specific action.<br />A function is a subprogram that computes a value.<br /> Functions and procedures are structured alike, except that functions have a RETURN clause<br />
  36. 36. CallableStatement<br />A parameter of function or procedure can be ther in three modes :<br />in (default)<br />out <br />inout<br />Y=X*X X=X*X<br />in<br />inout<br />out<br />
  37. 37. Steps to work with CallableStatement Object<br />Create query calling procedure<br />String query= “{ call procedure_name(?,?)}”;<br />Create CallableStatement object<br />CallableStatementcs=con.prepareCall(query);<br />Register out parameters with jdbc types.<br />Jdbc types are bridge data types between java data types and db s/w data types.<br />cs.registerOutParameter(param_index,Types.INTEGER);<br />Set values for IN parameters using setType(-,-).<br />cs.setInt(parameter_index,value);<br />Represents procedure is available on the db s/w<br />
  38. 38. Steps to work with CallableStatement Object<br />Execute the procedure<br />boolean b= cs.execute();<br />Gather the result from OUT parameter using getType() method.<br />int result=cs.getType(column_index);<br />For more executions repeat steps 4 , 5, and 6.<br />Close the CallableStatement object.<br />cs.close();<br />
  39. 39. Mapping Java Types to SQL Types<br />SQL type Java Type<br />CHAR, VARCHAR, LONGVARCHAR String<br />NUMERIC, DECIMAL java.math.BigDecimal<br />BIT boolean<br />TINYINT byte<br />SMALLINT short<br />INTEGER int<br />BIGINT long<br />REAL float<br />FLOAT, DOUBLE double<br />BINARY, VARBINARY, LONGVARBINARY byte[]<br />DATE java.sql.Date<br />TIME java.sql.Time<br />TIMESTAMP java.sql.Timestamp<br />
  40. 40. Database Time<br />Java defines three classes to help<br />java.sql.Date<br />year, month, day<br />java.sql.Time<br />hours, minutes, seconds<br />java.sql.Timestamp<br />year, month, day, hours, minutes, seconds, nanoseconds<br />usually use this one<br />
  41. 41. Metadata with JDBC<br />Used to get information about tables, views, column names, column types, stored procedures, result sets, and databases.<br />You can use database metadata to<br />Discover database schema information.<br />Discover database users, tables, views, and stored procedures<br />Understand and analyze the result sets returned by SQL queries<br />Determine the signature of a specific stored procedure in the database.<br />Identify the primary/foreign keys for a given table<br />
  42. 42. Metadata in JDBC<br />DatabaseMetaData : Gives limitations & capabilities of underlying DB s/w.<br />Object of a class that implements java.sql.DatabaseMetaData interface.<br />DatabaseMetaDatadbmd=conn.getMetaData();<br />Invoke various methos on dbmd object to gather the details about the DB s/w pointed by Connection object.<br />ResultsetMetaData : Gives details about table that is represented by Resultset object.<br />Object of a class that implements java.sql.ResultsetMetaData interface.<br />ResultsetMetaDatarsmd=resltSetOb.getMetaData();<br />
  43. 43. Metadata in JDBC<br />ParameterMetaData : Gives details about place holders kept in queries.<br />Object of a class that implements java.sql.ParameterMetaData interface.<br />PreparedStatementpst=con.prepareStatement( “insert into items values(?,?,?,?)”);<br />ParameterMetaData d=pst.getParameterMetaData();<br />If any method invoked in DatabaseMetaData returns 0 or null , it means the driver is not capable of gathering certain information regarding DB s/w<br />Most of the drivers doesn’t support ParameterMetaData<br />
  44. 44. JDBC 2.0<br />Scrollable result set<br />Batch updates<br />Advanced data types<br />Blobs, objects, structured types<br />Rowsets<br />Persistent JavaBeans<br />JNDI<br />Connection Pooling<br />Distributed transactions via JTS<br />
  45. 45. Scrollable ResultSet<br />ResultSet Object<br />Non-Scrollable ResultSet Object<br />Scrollable ResultSet Object<br />ResultSet object that allows to access the records in one direction is non-scrollable.<br />ResultSet object that allows to access the records bi-directionally is called scrollable<br />
  46. 46. Scrollable ResultSet<br />JDBC 2.0 introduces scrollable results sets whose values can be read and updated if reading and updating is supported by the underlying database.<br /> With scrollable result sets, any row can be selected at random, and the result set can be traversed forwards and backwards.<br />One advantage to the new result set is you can update a set of matching rows without having to issue an additional executeUpdate call.<br />
  47. 47. Scrollable ResultSet<br />Both Statements and PreparedStatements have an additional constructor that accepts a scroll type and an update type parameter<br />The scroll type value can be one of the following values: <br />ResultSet.TYPE_FORWARD_ONLYDefault behavior in JDBC 1.0, application can only call next() on the result set. <br />ResultSet.SCROLL_SENSITIVEResultSet is fully navigable and updates are reflected in the result set as they occur. <br />ResultSet.SCROLL_INSENSITIVEResult set is fully navigable, but updates are only visible after the result set is closed. You need to create a new result set to see the results. <br />
  48. 48. Scrollable ResultSet<br />The update type parameter can be one of the following two values: <br />ResultSet.CONCUR_READ_ONLYThe result set is read only. <br />ResultSet.CONCUR_UPDATABLEThe result set can be updated. <br />You can verify that your database supports these types by calling :<br />con.getMetaData().supportsResultSetConcurrency() method <br />
  49. 49. Navigating the ResultSet<br />The fully scrollable result set returns a cursor which can be moved using simple commands.<br />By default the result set cursor points to the row before the first row of the result set.<br /> A call to next() retrieves the first result set row<br />beforeFirst(): Default position. Puts cursor before the first row of the result set. <br />first(): Puts cursor on the first row of the result set. <br />last(): Puts cursor before the last row of the result set. <br />afterLast() Puts cursor beyond last row of the result set. Calls to previous moves backwards through the ResultSet. <br />absolute(pos): Puts cursor at the row number position where absolute(1) is the first row and absolute(-1) is the last row. <br />relative(pos): Puts cursor at a row relative to its current position where relative(1) moves row cursor one row forward. <br />
  50. 50. Updatable ResultSet Object<br />If modifications done in the ResultSet object is reflecting in the DB table, then ResultSet object is called as Updatable ResultSet object.<br />We can perform insert, update, delete operations on the table without SQL statements.<br />You can update a value in a result set by calling the ResultSet.update<type> method on the row where the cursor is positioned<br />The update applies only to the result set until the call to rs.updateRow(), which updates the underlying database<br />Closing the result set before calling updateRow will lose any edits applied to the result set<br />
  51. 51. Updatable ResultSet Object<br />Inserting a new row uses the same update<type> methods<br />rs.moveToInsertRow is called before and rs.insertRow() is called after the fields have been initialized<br />You can delete the current row with a call to rs.deleteRow()<br />Is not suitable for bulk delete and bulk update operations.<br />Only ScrollableResultSet can become UpdatableResultSet.<br />
  52. 52. Batch Processing<br />Is a process of combining related queries into single unit, sending them to DB s/w as batch and getting their result as a batch.<br />Instead of sending multiple queries to DB s/w for multiple times, send queries as a batch.<br />Reduces network round trips between java application and DB s/w.<br />Helps the programmer to work with Transactions. <br />
  53. 53. Batch Processing<br />The calls to stmt.addBatch(-) append statements to the original Statement.<br />The call to executeBatch() submits the entire statement with all the appends to the database.<br />The return result of the addBatch method is an array of row counts affected for each statement executed in the batch job.<br />If a problem occurred, a java.sql.BatchUpdateException is thrown.<br />Once select query is executed , it generates ResultSet object. Since ResultSet object cannot be stored in integer array, batch processing cannot include select queries.<br />
  54. 54. Transaction Management<br />Is all about combining set of related operations into a single unit and executing them by applying do everything or nothing principle<br />Transactions are not explicitly opened and closed<br />Instead, the connection has a state called AutoCommit mode<br />if AutoCommit is true, then every statement is automatically committed<br />default case: true<br />
  55. 55. setAutoCommit<br />Connection.setAutoCommit(boolean)<br />if AutoCommit is false, then every statement is added to an ongoing transaction<br />you must explicitly commit or rollback the transaction using Connection.commit() and Connection.rollback()<br />
  56. 56. RowSets<br />We can send only those java objects over the network which are serializable.<br />ResultSet object is not a serializable object, so we cannot send that object over network.<br />To overcome this problem jdbc has given support for RowSet object which are extension to ResultSet object and can be sent over network.<br />All JDBC drivers doesn’t support RowSets.<br />
  57. 57. Performance Tuning For JDBC API<br />
  58. 58. Why Optimize?<br />On average, a web request performs 4 database queries.<br />Experience has shown that database calls are typical performance bottleneck.<br />Bad JDBC can overwhelm the database.<br />
  59. 59. JDBC API<br />SQL: “SELECT * FROM TABLE”<br />java.sql.PreparedStatement<br />java.sql.CallableStatement<br />Cache data on client.<br />MOST VERSATILE<br />MOST OPTIMIZATION<br />
  60. 60. JDBC API<br />SQL STATEMENTS<br />Most flexible<br />Least reliable<br />Must be recompiled in database for each use<br />PREPARED STATEMENT<br />Represents a precompiled SQL statement<br />Can be used to efficiently execute statement multiple times<br />Somewhat flexible –can create new ones as needed<br />
  61. 61. JDBC API<br />CALLABLE STATEMENT<br />Used to execute SQL stored procedures. <br />Same syntax as PreparedStatement.<br />Least flexible.<br />Most optimized DB call.<br />PreparedStatement gives better performance when compared to Statement because it is pre-parsed and pre-compiled by the database once for the first time and then onwards it reuses the parsed and compiled statement.<br />CallableStatement gives better performance when compared to PreparedStatement and Statement when there is a requirement for single request to process multiple complex statements<br />
  62. 62. JDBC API<br />CACHE<br />Keep data within client to reduce the number of round-trips to the database.<br />Every database schema generally has read-only and read-mostly tables. These tables are called as lookup tables.<br />Read-only tables contain static data that never changes in its life time. Read-mostly tables contain semi dynamic data that changes often<br />If an application reads data from these tables for every client request, then it is redundant, unnecessary and expensive.<br /> The solution for this problem is to cache the read-only table data by reading the data from that table once and caching the read-mostly table data by reading and refreshing with time limit<br />
  63. 63. Basic Design Techniques<br />Use Database Connection Pool<br />Don’t useDriverManager.getConnection() often. JDBC connections can take 0.5 to 2 seconds to create.<br />Create Pool of Connections and reuse them.<br />Use multi-threading with Connection Pooling to address network latency<br />Threads can issue queries over separate database connections.<br />OPTIMIZATION WITH RESULTSET OBJECT<br />Set up proper direction for processing the rows<br />Use proper get methods<br />Close ResultSet when finished<br />
  64. 64. Basic Design Techniques<br />Single-batch Transactions<br />Collect set of operations and submit transaction in one statement<br />BEGIN TRANSACTION<br /> UPDATE TABLE1... <br /> INSERT INTO TABLE2…<br /> DELETE TABLE3<br /> COMMIT<br />DB obtains necessary locks on rows and tables, uses and releases them in one step<br />
  65. 65. Basic Design Techniques<br />Smart Queries<br />Make queries as specific as possible<br />Put more logic into SQL statements<br />DB are designed to use SQL efficiently<br />Proper use of SQL can avoid performance problems<br />Smart Query Ex: get employees in ENG dept<br />Instead of: <br /> SELECT * FROM employees;<br /> SELECT * FROM dept;<br /> (and joining on Java application side)<br />Use database join:<br /> SELECT employees.* FROM employees E, dept D WHERE E.DEPTNO = D.DEPTNO AND D.DEPTTYPE = ‘ENG’;<br />
  66. 66. Basic Design Techniques<br />Smart Query Guidelines<br />Use DB for filtering<br />Use Java for business logic<br />DB does filtering very well<br />DB business logic is poor<br />
  67. 67. Connection Pooling<br />There are two types of jdbc connection objects :<br />Direct Connection Object<br />Pooled Connection Object<br />The JDBC Connection object that is created by the programmer manually is called direct connection object.<br />The JDBC Connection object that is collected from JDBC Connection pool is called pooled connection object.<br />JDBC Connection pool is a factory that contains set of readily available JDBC connection objects.<br />
  68. 68. Connection Pooling<br />Using connection pools helps to both alleviate connection management overhead and decrease development tasks for data access.<br />Each time an application attempts to access a backend store (such as a database), it requires resources to create, maintain, and release a connection to that datastore.<br />To mitigate the strain this process can place on overall application resources, the Application Server enables administrators to establish a pool of backend connections that applications can share on an application server<br />
  69. 69. Advantages of Connection Pooling<br />Connection pooling can improve the response time of any application that requires connections, especially Web-based applications.<br />With connection pooling, most user requests do not incur the overhead of creating a new connection because the data source can locate and use an existing connection from the pool of connections<br />Re usability, we can reuse the existing connection already existing<br />It also simplifies the design in terms of managing the connections; we can delegate the connection creation, max number of connections for an application, max idle time for a connection etc. using the some kind of a connection pool manager<br />
  70. 70. C3P0 Connection Pooling<br />c3p0 is an easy-to-use library for making traditional JDBC drivers "enterprise-ready" by augmenting them with functionality defined by the jdbc3 spec and the optional extensions to jdbc2<br />c3p0 provides several useful services:<br />Classes which adapt traditional DriverManager-based JDBC drivers to the new javax.sql.DataSource scheme for acquiring database Connections.<br />Transparent pooling of Connection and PreparedStatements behind DataSources which can "wrap" around traditional drivers or arbitrary unpooledDataSources.<br />
  71. 71. Working with C3P0 Connection Pool<br />Put the file lib/c3p0- somewhere in your CLASSPATH<br />There are three ways of acquiring c3p0 pool-backed DataSources:<br />directly instantiate and configure a ComboPooledDataSource bean<br />use the DataSources factory class<br />"build your own" pool-backed DataSource by directly instantiating PoolBackedDataSource and setting its ConectionPoolDataSource<br />
  72. 72. Instantiating and Configuring a ComboPooledDataSource<br />the most straightforward way to create a c3p0 pooling DataSource is to instantiate an instance of com.mchange.v2.c3p0.ComboPooledDataSource<br />This is a JavaBean-style class with a public, no-arg constructor<br />Before you use the DataSource, you'll have to be sure to set at least the property jdbcUrl<br />You may also want to set user and password, and if you have not externally preloaded the old-style JDBC driver you'll use you should set the driverClass. <br />
  73. 73. Using the DataSources factory class<br />use the static factory class com.mchange.v2.c3p0.DataSources<br />Can be used to build unpooledDataSources from traditional JDBC drivers<br />Can be used to build pooled DataSources from unpooledDataSources<br />If you use the DataSources factory class, and you want to programmatically override default configuration parameters, you can supply a map of override properties<br />
  74. 74. Java Naming And Directory Interface (JNDI)<br />Java application uses JNDI API to interact with Naming Registry s/w.<br />Every JDBC Connection pool will be represented by Data Source object.<br />To make this data source object publically visible, we register data source object in a special place called naming registry having nick name (jndi name).<br />In order to access a JDBC Connection object of a Connection pool, we need to access the data source object pointing to that connection pool.<br />
  75. 75. Java Naming And Directory Interface (JNDI)<br />Java application needs to perform look up or search operation on naming registry to get the data source object.<br />Use getConnection () method on the data source object to get the connection object from the connection pool.<br />
  76. 76.
  77. 77. An open source DataBase Management System <br />Community Editions free<br />Enterprise Editions free license but a subscription and maintenance fee<br />Suitable situations range from small enterprise to global, enterprise-wide systems <br />Multiple platforms<br />
  78. 78. MySQL Tools<br />The core system includes only a command-line tool<br />‘mysqladmin’<br />GUI tools available separately from MySQL are <br />‘MySQL Administrator’ (a DBA tool) and <br />‘MySQL Query Browser’ <br />
  79. 79. SQLyog is a GUI front-end for MySQL (there are others) - Community and Enterprise Editions<br />Allows Data Definition and Data Manipulation<br />After loading it and before using it you need to ‘Connect’ to the right MySQL instance<br />A tutorial, with a range of activities to get familiar with it, is available at<br />
  80. 80. SQLyog screen<br />
  81. 81. References<br />For further information see<br /><br /> includes forums and FAQs<br />