Χειμερινό εξάμηνο Πέτρος Κωμοδρόμος. eng.ucy.ac.cy/petros

Μέγεθος: px
Εμφάνιση ξεκινά από τη σελίδα:

Download "Χειμερινό εξάμηνο Πέτρος Κωμοδρόμος. eng.ucy.ac.cy/petros"

Transcript

1 23. Βάσεις δεδομένων (databases) και JDBC Χειμερινό εξάμηνο 2005 Πέτρος Κωμοδρόμος eng.ucy.ac.cy/petros 1

2 Θέματα Introduction Relational Databases Relational Database Overview: The books Database SQL Basic SELECT Query WHERE Clause ORDER BY Clause Merging Data from Multiple Tables: INNER JOIN INSERT Statement UPDATE Statement DELETE Statement 2

3 Instructions to install MySQL and MySQL Connector/J Instructions on Setting MySQL User Account Creating Database books in MySQL Manipulating Databases with JDBC Connecting to and Querying a Database Querying the books Database Stored Procedures RowSet Interface 3

4 Introduction Database Collection of data DBMS SQL Database management system Storing and organizing data Relational database Structured Query Language 4

5 RDBMS Relational database management system MySQL JDBC o Open source o Available for both Windows and Linux o dev.mysql.com/downloads/mysql/4.0.hml Java Database Connectivity JDBC driver o Enable Java applications to connect to database o Enable programmers to manipulate databases using JDBC 5

6 Relational Databases Relational database Table o Rows, columns Primary key SQL queries o Unique data Specify which data to select from a table 6

7 Employee table sample data. 7

8 Result of selecting distinct Department and Location data from table Employee. 8

9 Relational Database Overview: The books Database Sample books database Four tables o authors authorid, firstname, lastname o publishers o titles publisherid, publishername isbn,, title, editionnumber,, copyright, publisherid, imagefile,, price o authorisbn authorid, isbn 9

10 authors table from books. Column authorid firstname lastname Description Author s ID number in the database. In the books database, this integer column is defined as autoincremented. For each row inserted in this table, the authorid value is increased by 1 automatically to ensure that each row has a unique authorid. This column represents the table s primary key. Author s first name (a string). Author s last name (a string). authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 10

11 publishers table from books. Column publisherid publishername Description The publisher s ID number in the database. This autoincremented integer is the table s primary key. The name of the publisher (a string). publisherid publishername 1 Prentice Hall 2 Prentice Hall PTG 11

12 titles table from books. Column isbn title editionnumber copyright publisherid imagefile price Description ISBN of the book (a string). The table s primary key. ISBN is an abbreviation for International Standard Book Number a numbering scheme that publishers worldwide use to give every book a unique identification number. Title of the book (a string). Edition number of the book (an integer). Copyright year of the book (a string). Publisher s ID number (an integer). A foreign key that relates this table to the publishers table. Name of the file containing the book s cover image (a string). Suggested retail price of the book (a real number). [Note: The prices shown in Fig are for example purposes only.] 12

13 Relational Database Overview: : The books Database Foreign key A column o matches the primary key column in another table Helps maintain the Rule of Referential Integrity o Every foreign key value must appear as another table s s primary key value Entity-relationship (ER) diagram Tables in the database Relationships among tables 13

14 Rule of Entity Integrity Primary key uniquely identifies each row Every row must have a value for every column of the primary key Value of the primary key must be unique in the table 14

15 Common Programming Errors Not providing a value for every column in a primary key breaks the t Rule of Entity Integrity and causes the DBMS to report an error. Providing the same value for the primary key in multiple rows causes the DBMS to report an error. Providing a foreign-key value that does not appear as a primary-key value in another table breaks the Rule of Referential Integrity and causes s the DBMS to report an error. 15

16 Sample data from the titles table of books isbn title editionn umber copyright publisher ID Image File price C How to Program chtp4.jpg C++ How to Program cpphtp4.j pg Java Web Services for Experienced Programmers Java How to Program jwsfep1.j pg jhtp6.jpg X The Complete C++ Training Course cppctc4.j pg Advanced Java 2 Platform How to Program advjhtp1. jpg

17 authorisbn table from books. Column Description authorid isbn The author s ID number, a foreign key to the authors table. The ISBN for a book, a foreign key to the titles table. authorid isbn authorid isbn

18 Table relationships in books. 18

19 SQL keywords: SQL queries and statements SQL keyword Description SELECT FROM WHERE GROUP BY ORDER BY INNER JOIN INSERT UPDATE DELETE Retrieves data from one or more tables. Tables involved in the query. Required in every SELECT. Criteria for selection that determine the rows to be retrieved, deleted or updated. Optional in a SQL query or a SQL statement. Criteria for grouping rows. Optional in a SELECT query. Criteria for ordering rows. Optional in a SELECT query. Merge rows from multiple tables. Insert rows into a specified table. Update rows in a specified table. Delete rows from a specified table. 19

20 Basic SELECT Query Simplest format of a SELECT query SELECT * FROM tablename o SELECT * FROM authors Select specific fields from a table SELECT authorid, lastname FROM authors authorid lastname 1 Deitel 2 Deitel 3 Nieto 4 Santry 20

21 Παρατηρήσεις For most queries, the asterisk (*)( ) should not be used to specify column names. In general, programmers process results by knowing in advance the e order of the columns in the result for example selecting authorid and lastname from table authors ensures that the columns will appear in the result with authorid as the first column and lastname as the second column. Programs typically process result columns by specifying the column number in the result (starting from number 1 for the first column). Selecting columns by name also a avoids returning unneeded columns and protects against changes in the actual a order of the columns in the table(s). If a programmer assumes that the columns are always returned in the same order from a query that uses the asterisk (*), the program may process p the result incorrectly. If the column order in the table(s) ) changes or if additional columns are added at a later time, the order of the columns in the t result would change accordingly. 21

22 WHERE Clause specify the selection criteria SELECT columnname1, columnname2, FROM tablename WHERE criteria > SELECT title, editionnumber,, copyright FROM titleswhere copyright > 2002 title editionnumber copyright The Complete C++ Training Course Java How to Program C How to Program Internet and World Wide Web How to Program Java How to Program C# How to Program

23 WHERE Clause WHERE clause condition operators <, >, <=, >=, =, <> LIKE o wildcard characters % and _ (in some systems: * and?) > SELECT authorid, firstname, lastname FROM authors WHERE lastname LIKE D% D% authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 23

24 WHERE Clause > SELECT authorid, firstname, lastname FROM authorswhere lastname LIKE _i% authorid firstname lastname 3 Tem Nieto 24

25 ORDER BY Clause Optional ORDER BY clause SELECT columnname1, columnname2, FROM tablename ORDER BY column ASC > SELECT authorid, firstname, lastname FROM authors ORDER BY lastname ASC SELECT columnname1, columnname2, FROM tablename ORDER BY column DESC > SELECT authorid, firstname, lastname FROM authors ORDER BY lastname DESC 25

26 authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry authorid firstname lastname 4 Sean Santry 3 Tem Nieto 1 Harvey Deitel 2 Paul Deitel 26

27 ORDER BY Clause ORDER BY multiple fields ORDER BY column1 sortingorder, column2 sortingorder, > SELECT authorid, firstname, lastname FROM authors ORDER BY lastname, firstname authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 27

28 ORDER BY Clause Combine the WHERE and ORDER BY clauses > SELECT isbn,, title, editionnumber,, copyright, price FROM titles WHERE title LIKE %How to Program ORDER BY title ASC isbn title Edition -Number copyright price Advanced Java 2 Platform How to Program C How to Program C++ How to Program x e-business and e-commerce How to 1 Program Internet and World Wide Web How 3 to Program Perl How to Program Visual Basic 6 How to Program XML How to Program

29 Merging Data from Multiple Tables: INNER JOIN Split related data into separate tables Join the tables Merge data from multiple tables into a single view INNER JOIN o SELECT columnname1, columnname2, FROM table1 INNER JOIN table2 ON table1.columnname = table2.column2name o SELECT firstname, lastname, isbn FROM authors, authorisbn INNER JOIN authorisbn ON authors.authorid = authorisbn.authorid ORDER BY lastname, firstname 29

30 Παρατηρήσεις If a SQL statement includes columns from multiple tables that have the same name, the statement must precede those column names with their table names and a dot (e.g., authors.authorid). In a query, failure to qualify names for columns that have the same s name in two or more tables is an error. 30

31 Sampling of authors and ISBNs for the books they have written in ascending order by lastname and firstname. firstname lastname isbn first Name lastname isbn Harvey Deitel Paul Deitel Harvey Deitel Paul Deitel Harvey Deitel Paul Deitel Harvey Deitel Paul Deitel Harvey Deitel Paul Deitel Harvey Deitel Paul Deitel Harvey Deitel Tem Nieto Harvey Deitel Tem Nieto x Paul Deitel Sean Santry

32 Insert a row into a table INSERT Statement INSERT INTO tablename ( columnname1,, columnnamen ) VALUES ( value1,, valuen ) > INSERT INTO authors ( firstname, lastname ) VALUES ( Sue, Smith ) authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 5 Sue Smith 32

33 Common Programming Error SQL uses the single-quote (')( ) character as a delimiter for strings. To specify a string containing a single quote (e.g., O Malley) in a SQL statement, the string must have two single quotes in the position where the single-quote character appears in the string (e.g., 'O''Malley'). The first of the two single-quote characters acts as an escape character for the second. Not escaping single-quote characters in a string that is part of a SQL statement is a SQL syntax error. 33

34 UPDATE Statement Modify data in a table UPDATE tablename SET columnname1 = value1,, columnnamen = valuen WHERE criteria o UPDATE authors SET lastname = Jones WHERE lastname = Smith AND firstname = Sue authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 5 Sue Jones 34

35 DELETE Statement Remove data from a table DELETE FROM tablename WHERE criteria o DELETE FROM authors WHERE lastname = Jones AND firstname = Sue authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 35

36 Instructions to Install MySQL and MySQL Connector/J Install MySQL Insert CD and change directory to D:\software software\mysql\mysql c-win Double click SETUP.EXE Following the instruction Install MySQL Connector/J Copy mysql-connector connector-java production.zip Open mysql-connector connector-java production.zip o Extract its content to the C:\ driv 36

37 Instructions on Setting MySQL User Account Set up a user account Start database server by executing the script C:\mysql mysql\bin\mysqld Start the MySQL monitor by executing the command C:\mysql mysql\bin> bin>mysql h localhost u u root Create an account mysql> > USE mysql; mysql> > INSERT INTO user SET Host= localhost localhost, User= jhtp6 jhtp6,, Password=PASSWORD( jhtp6 jhtp6 ), Select_priv= Y, Insert_priv= Y, Update_priv= Y, Delete_priv= Y, Create_priv= Y, Drop_priv= Y, References_priv= Y, Execute_priv= Y ; mysql> > FLUSH PRIVILEGES; mysql> > exit; 37

38 Creating Database books in MySQL Create books database Open Command Prompt Change to the C:\mysql mysql\bin directory Start database by executing the command C:\mysql mysql\bin\mysqld Copy SQL script books.sql to C:\mysql mysql\bin directory Open another Command Prompt Change to the C:\mysql mysql\bin directory Create the books database by executing the command C:\mysql mysql\bin> bin>mysql h localhost u u jhtp6 p p < books.sql 38

39 Manipulating Databases with JDBC Connect to a database Query the database Display the results of the query in JTable 39

40 Connecting to and Querying a Database DisplayAuthors Retrieves the entire authors table Displays the data in the standard output stream Example illustrates o Connect to the database o Query the database o Process the result 40

41 1 // Fig : DisplayAuthors.java 2 // Displaying the contents of the authors table. 3 import java.sql.connection; 4 import java.sql.statement; 5 import java.sql.drivermanager; 6 import java.sql.resultset; 7 import java.sql.resultsetmetadata; 8 import java.sql.sqlexception; 9 10 public class DisplayAuthors 11 { 12 // JDBC driver name and database URL 13 static final String JDBC_DRIVER = "com.mysql.jdbc.driver"; 14 static final String DATABASE_URL = "jdbc:mysql://localhost/books"; // launch the application 17 public static void main( String args[] ) 18 { 19 Connection connection = null; // manages connection 20 Statement statement = null; // query statement // connect to database books and query database 23 try 24 { 25 Class.forName( JDBC_DRIVER ); // load database driver class // establish connection to database 28 connection = Imports the JDBC classes and interfaces from package java.sql Declare a String constant that specifies the JDBC driver s class name Declare a String constant that specifies the database URL Loads the class definition for the database driver. Declare and initialize a Connection reference called connection. 29 DriverManager.getConnection( ΠΠΜ 500: Προχωρημένη Ανάπτυξη DATABASE_URL, Λογισμικού Εφαρμογών "jhtp6", Μηχανικής "jhtp6" ); 30 41

42 31 // create Statement for querying database 32 statement = connection.createstatement(); // query database 35 ResultSet resultset = statement.executequery( 36 "SELECT authorid, firstname, lastname FROM authors" ); 37 Obtains the metadata 38 // process query results for the ResultSet. 39 ResultSetMetaData metadata = resultset.getmetadata(); 40 int numberofcolumns = metadata.getcolumncount(); 41 System.out.println( "Authors Table of Books Database:" ); for ( int i = 1; i <= numberofcolumns; i++ ) 44 System.out.printf( "%-8s\t", metadata.getcolumnname( i ) ); 45 System.out.println(); while ( resultset.next() ) 48 { 49 for ( int i = 1; i <= numberofcolumns; i++ ) 50 System.out.printf( "%-8s\t", resultset.getobject( i ) ); 51 System.out.println(); 52 } // end while 53 } // end try 54 catch ( SQLException sqlexception ) 55 { 56 sqlexception.printstacktrace(); 57 System.exit( 1 ); 58 } // end catch Invokes Connection method createstatement to obtain an object that implements interface Statement. Position the ResultSet cursor to the first row in the ResultSet with method next Use the Statement object s executequery method to execute a query that selects all the author information from table authors. Uses ResultSetMetaData method getcolumncount to retrieve the number of columns in the ResultSet. Extract the contents of one column in the current row Catch SQLException, which is thrown if the query execution or ResultSet process fails Obtain column name using method getcolumnname 42

43 59 catch ( ClassNotFoundException classnotfound ) 60 { 61 classnotfound.printstacktrace(); 62 System.exit( 1 ); 63 } // end catch 64 finally // ensure statement and connection are closed properly 65 { 66 try 67 { 68 statement.close(); 69 connection.close(); 70 } // end try 71 catch ( Exception exception ) 72 { 73 exception.printstacktrace(); 74 System.exit( 1 ); 75 } // end catch 76 } // end finally 77 } // end main 78 } // end class DisplayAuthors Authors Table of Books Database: authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry ClassNotFoundException is thrown if the class loader cannot locate the driver class Close the Statement and the database Connection. 43

44 JDBC driver types. Type Description 1 The JDBC-to-ODBC bridge driver connects Java programs to Microsoft ODBC (Open Database Connectivity) data sources. The Java 2 Software Development Kit from Sun Microsystems, Inc. includes the JDBC-to-ODBC Bridge driver (sun.jdbc.odbc.jdbcodbcdriver). This driver typically requires the ODBC driver on the client computer and normally requires configuration of ODBC data sources. The Bridge driver was introduced primarily for development purposes, before other types of drivers were available, and should not be used for production applications. 2 Native-API, partly Java drivers enable JDBC programs to use databasespecific APIs (normally written in C or C++) that allow client programs to access databases via the Java Native Interface (JNI). JNI is a bridge between a JVM and code written and compiled in a platform-specific language such as C or C++. Such code is known as native code. JNI enables Java applications to interact with native code. A Type 2 driver translates JDBC into databasespecific calls. Type 2 drivers were introduced for reasons similar to the Type 1 ODBC bridge driver. 3 Pure Java client to server drivers take JDBC requests and translate them into a network protocol that is not database specific. These requests are sent to a server, which translates the database requests into a database-specific protocol. 4 Pure Java drivers implement database-specific network protocols, so that Java programs can connect directly to a database. 44

45 Software Engineering Observations Most major database vendors provide their own JDBC database drivers, and many third-party vendors provide JDBC drivers as well. For more information on JDBC drivers, visit the Sun Microsystems JDBC Web site, servlet.java.sun.com/products/jdbc/drivers. On the Microsoft Windows platform, most databases support access via Open Database Connectivity (ODBC). ODBC is a technology developed by Microsoft to allow generic access to disparate database systems on the Windows platform (and some UNIX platforms). The JDBC-to to-odbc Bridge allows any Java program to access any ODBC data source. The driver is class JdbcOdbcDriver in package sun.jdbc.odbc. Most database management systems require the user to log in before accessing the database contents. DriverManager method getconnection is overloaded with versions that enable the program to supply the user name and d password to gain access. 45

46 Metadata enables programs to process ResultSet contents dynamically when detailed information about the ResultSet is not known in advance. Initially, a ResultSet cursor is positioned before the first row. Attempting to access a ResultSet s contents before positioning the ResultSet cursor to the first row with method next causes a SQLException. If a query specifies the exact columns to select from the database, the ResultSet contains the columns in the specified order. In this case, using the column number to obtain the column s s value is more efficient than using the column name. The column number provides direct access to the specified column. Using the column name requires a linear search of the column names to locate the appropriate column. Each Statement object can open only one ResultSet object at a time. When a Statement returns a new ResultSet,, the Statement closes the prior ResultSet. To use multiple ResultSets in parallel, separate Statement objects must return the ResultSets. 46

47 Popular JDBC driver names and database URL. RDBMS JDBC driver name Database URL format MySQL ORACLE com.mysql.jdbc.driver oracle.jdbc.driver.oracledr iver jdbc:mysql://hostname/databasena me Number:databaseName DB2 COM.ibm.db2.jdbc.net.DB2Dri ver jdbc:db2:hostname:portnumber/data basename Sybase com.sybase.jdbc.sybdriver jdbc:sybase:tds:hostname:portnub er/databasename 47

48 Common Programming Errors Specifying column number 0 when obtaining values from a ResultSet causes a SQLException. Attempting to manipulate a ResultSet after closing the Statement that created the ResultSet causes a SQLException.. The program discards the ResultSet when the corresponding Statement is closed. 48

49 Querying the books Database 1 // Fig : ResultSetTableModel.java 2 // A TableModel that supplies ResultSet data to a JTable. 3 import java.sql.connection; 4 import java.sql.statement; 5 import java.sql.drivermanager; 6 import java.sql.resultset; 7 import java.sql.resultsetmetadata; 8 import java.sql.sqlexception; 9 import javax.swing.table.abstracttablemodel; // ResultSet rows and columns are counted from 1 and JTable 12 // rows and columns are counted from 0. When processing 13 // ResultSet rows or columns for use in a JTable, it is 14 // necessary to add 1 to the row or column number to manipulate 15 // the appropriate ResultSet column (i.e., JTable column 0 is 16 // ResultSet column 1 and JTable row 0 is ResultSet row 1). 17 public class ResultSetTableModel extends AbstractTableModel 18 { 19 private Connection connection; 20 private Statement statement; 21 private ResultSet resultset; 22 private ResultSetMetaData metadata; 23 private int numberofrows; // keep track of database connection status 26 private boolean connectedtodatabase = false; 27 Class ResultSetTableModel extends class AbstractTableModel, which implements interface TableModel. Instance variable keeps track of database connection status 49

50 28 // constructor initializes resultset and obtains its meta data object; 29 // determines number of rows 30 public ResultSetTableModel( String driver, String url, 31 String username, String password, String query ) 32 throws SQLException, ClassNotFoundException 33 { 34 // load database driver class 35 Class.forName( driver ); // connect to database 38 connection = DriverManager.getConnection( url, username, password ); // create Statement to query database 41 statement = connection.createstatement( 42 ResultSet.TYPE_SCROLL_INSENSITIVE, 43 ResultSet.CONCUR_READ_ONLY ); // update database connection status 46 connectedtodatabase = true; // set query and execute it 49 setquery( query ); 50 } // end constructor ResultSetTableModel 51 Constructor accepts five String arguments the driver class name, the database URL, the username, the password and the default query to perform Establishes a connection to the database. Invokes Connection method createstatement to create a Statement object. Indicate that connect to database is successful Invokes ResultSetTableModel method setquery to perform the default query. 50

51 52 // get class that represents column type 53 public Class getcolumnclass( int column ) throws IllegalStateException 54 { 55 // ensure database connection is available 56 if (!connectedtodatabase ) 57 throw new IllegalStateException( "Not Connected to Database" ); // determine Java class of column 60 try 61 { 62 String classname = metadata.getcolumnclassname( column + 1 ); // return Class object that represents classname 65 return Class.forName( classname ); Loads the class definition for the class and 66 } // end try returns the corresponding Class object. 67 catch ( Exception exception ) 68 { 69 exception.printstacktrace(); 70 } // end catch return Object.class; // if problems occur above, assume type Object 73 } // end method getcolumnclass 74 Override method getcolumnclass to obtain a Class object that represents the superclass of all objects in a particular column Verify database connection status Obtains the fully qualified class name for the specified column. Returns the default type. 51

52 75 // get number of columns in ResultSet 76 public int getcolumncount() throws IllegalStateException 77 { 78 // ensure database connection is available 79 if (!connectedtodatabase ) 80 throw new IllegalStateException( "Not Connected to Database" ); // determine number of columns 83 try 84 { 85 return metadata.getcolumncount(); 86 } // end try 87 catch ( SQLException sqlexception ) 88 { 89 sqlexception.printstacktrace(); 90 } // end catch return 0; // if problems occur above, return 0 for number of columns 93 } // end method getcolumncount Override method getcolumnname to 94 obtain the name of the column in the 95 // get name of a particular column in ResultSet model s underlying ResultSet 96 public String getcolumnname( int column ) throws IllegalStateException 97 { 98 // ensure database connection is available 99 if (!connectedtodatabase ) 100 throw new IllegalStateException( "Not Connected to Database" ); 101 Override method getcolumncount to obtain the number of columns in the model s underlying ResultSet Obtains the number of columns in the ResultSet. 52

53 102 // determine column name 103 try 104 { 105 return metadata.getcolumnname( column + 1 ); 106 } // end try 107 catch ( SQLException sqlexception ) 108 { 109 sqlexception.printstacktrace(); 110 } // end catch return ""; // if problems, return empty string for column name 113 } // end method getcolumnname // return number of rows in ResultSet 116 public int getrowcount() throws IllegalStateException 117 { 118 // ensure database connection is available 119 if (!connectedtodatabase ) 120 throw new IllegalStateException( "Not Connected to Database" ); return numberofrows; 123 } // end method getrowcount 124 Obtains the column name from the ResultSet. Override method getrowcount to obtain the number of rows in the model s underlying ResultSet 53

54 125 // obtain value in particular row and column 126 public Object getvalueat( int row, int column ) 127 throws IllegalStateException 128 { 129 // ensure database connection is available 130 if (!connectedtodatabase ) 131 throw new IllegalStateException( "Not Connected to Database" ); // obtain a value at specified ResultSet row and column 134 try 135 { 136 resultset.absolute( row + 1 ); 137 return resultset.getobject( column + 1 ); 138 } // end try 139 catch ( SQLException sqlexception ) 140 { 141 sqlexception.printstacktrace(); 142 } // end catch return ""; // if problems, return empty string object 145 } // end method getvalueat // set new database query string 148 public void setquery( String query ) 149 throws SQLException, IllegalStateException 150 { 151 // ensure database connection is available 152 if (!connectedtodatabase ) 153 throw new IllegalStateException( "Not Connected to Database" ); 154 Override method getvalueat to obtain the Object in a particular row and column of the model s underlying ResultSet Uses ResultSet method absolute to position the ResultSet cursor at a specific row. Uses ResultSet method getobject to obtain the Object in a specific column of the current row. 54

55 155 // specify query and execute it 156 resultset = statement.executequery( query ); // obtain meta data for ResultSet 159 metadata = resultset.getmetadata(); // determine number of rows in ResultSet 162 resultset.last(); // move to last row 163 numberofrows = resultset.getrow(); // get row number // notify JTable that model has changed 166 firetablestructurechanged(); 167 } // end method setquery 168 Executes the query to obtain a new ResultSet. Uses ResultSet method last to position the ResultSet cursor at the last row in the ResultSet. Uses ResultSet method getrow to obtain the row number for the current row in the ResultSet. Invokes method firetableastructurechanged to notify any JTable using this ResultSetTableModel object as its model that the structure of the model has changed. 55

56 169 // close Statement and Connection 170 public void disconnectfromdatabase() 171 { 172 if (!connectedtodatabase ) 173 return; // close Statement and Connection 176 try 177 { 178 statement.close(); 179 connection.close(); 180 } // end try 181 catch ( SQLException sqlexception ) 182 { 183 sqlexception.printstacktrace(); 184 } // end catch 185 finally // update database connection status 186 { 187 connectedtodatabase = false; 188 } // end finally 189 } // end method disconnectfromdatabase 190 } // end class ResultSetTableModel Method disconnectfromdatabase implement an appropriate termination method for class ResultSetTableModel Verify whether the connection is already terminated Close the Statement and Connection if a ResultSetTableModel object is garbage collected. Set connectedtodatabase to false to ensure that clients do not use an instance of ResultSetTableModel after that instance has already been terminated 56

57 Portability Tips Some JDBC drivers do not support scrollable ResultSets.. In such cases, the driver typically returns a ResultSet in which the cursor can move only forward. For more information, see your database driver documentation. Some JDBC drivers do not support updatable ResultSets.. In such cases, the driver typically returns a read-only ResultSet.. For more information, see your database driver documentation. 57

58 Common Programming Error Attempting to update a ResultSet when the database driver does not support updatable ResultSets causes SQLExceptions. Attempting to move the cursor backwards through a ResultSet when the database driver does not support backwards scrolling causes a SQLException. 58

59 ResultSet constants for specifying ResultSet type. ResultSet static type constant TYPE_FORWARD_ONLY Description Specifies that a ResultSet s cursor can move only in the forward direction (i.e., from the first row to the last row in the ResultSet). TYPE_SCROLL_INSENSITIVE Specifies that a ResultSet s cursor can scroll in either direction and that the changes made to the ResultSet during ResultSet processing are not reflected in the ResultSet unless the program queries the database again. TYPE_SCROLL_SENSITIVE Specifies that a ResultSet s cursor can scroll in either direction and that the changes made to the ResultSet during ResultSet processing are reflected immediately in the ResultSet. 59

60 ResultSet constants for specifying result properties. ResultSet static concurrency constant CONCUR_READ_ONLY CONCUR_UPDATABLE Description Specifies that a ResultSet cannot be updated (i.e., changes to the ResultSet contents cannot be reflected in the database with ResultSet s update methods). Specifies that a ResultSet can be updated (i.e., changes to the ResultSet contents can be reflected in the database with ResultSet s update methods). 60

61 1 // Fig : DisplayQueryResults.java 2 // Display the contents of the Authors table in the 3 // Books database. 4 import java.awt.borderlayout; 5 import java.awt.event.actionlistener; 6 import java.awt.event.actionevent; 7 import java.awt.event.windowadapter; 8 import java.awt.event.windowevent; 9 import java.sql.sqlexception; 10 import javax.swing.jframe; 11 import javax.swing.jtextarea; 12 import javax.swing.jscrollpane; 13 import javax.swing.scrollpaneconstants; 14 import javax.swing.jtable; 15 import javax.swing.joptionpane; 16 import javax.swing.jbutton; 17 import javax.swing.box; public class DisplayQueryResults extends JFrame 20 { 21 // JDBC driver and database URL 22 static final String JDBC_DRIVER = "com.mysql.jdbc.driver"; 23 static final String DATABASE_URL = "jdbc:mysql://localhost/books"; 24 static final String USERNAME= "jhtp6"; 25 static final String PASSWORD= "jhtp6"; 26 Declare the database driver class name, database URL, username and password for accessing the database 61

62 27 // default query selects all rows from authors table 28 static final String DEFAULT_QUERY = "SELECT * FROM authors"; private ResultSetTableModel tablemodel; 31 private JTextArea queryarea; // create ResultSetTableModel and GUI 34 public DisplayQueryResults() 35 { 36 super( "Displaying Query Results" ); // create ResultSetTableModel and display database table 39 try 40 { 41 // create TableModel for results of query SELECT * FROM authors 42 tablemodel = new ResultSetTableModel( JDBC_DRIVER, DATABASE_URL, 43 USERNAME, PASSWORD, DEFAULT_QUERY ); // set up JTextArea in which user types queries 46 queryarea = new JTextArea( DEFAULT_QUERY, 3, 100 ); 47 queryarea.setwrapstyleword( true ); 48 queryarea.setlinewrap( true ); JScrollPane scrollpane = new JScrollPane( queryarea, 51 ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, 52 ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER ); // set up JButton for submitting queries 55 JButton submitbutton = new JButton( "Submit Query" ); 56 Declare the default query Declare tablemodel to be a reference to ResultSetTableModel Create TableModel for results of default query SELECT * FROM authors 62

63 57 // create Box to manage placement of queryarea and 58 // submitbutton in GUI 59 Box box = Box.createHorizontalBox(); 60 box.add( scrollpane ); 61 box.add( submitbutton ); // create JTable delegate for tablemodel 64 JTable resulttable = new JTable( tablemodel ); // place GUI components on content pane 67 add( box, BorderLayout.NORTH ); 68 add( new JScrollPane( resulttable ), BorderLayout.CENTER ); // create event listener for submitbutton 71 submitbutton.addactionlistener( new ActionListener() 74 { 75 // pass query to table model 76 public void actionperformed( ActionEvent event ) 77 { 78 // perform a new query 79 try 80 { 81 tablemodel.setquery( queryarea.gettext() ); 82 } // end try 83 catch ( SQLException sqlexception ) 84 { 85 JOptionPane.showMessageDialog( null, 86 sqlexception.getmessage(), "Database error", 87 JOptionPane.ERROR_MESSAGE ); 88 Create JTable delegate for tablemodel Register an event handler for the submitbutton that the user clicks to submit a query to the database Invoke ResultSetTableModel method setquery to execute the new query 63

64 89 // try to recover from invalid user query 90 // by executing default query 91 try 92 { 93 tablemodel.setquery( DEFAULT_QUERY ); 94 queryarea.settext( DEFAULT_QUERY ); 95 } // end try 96 catch ( SQLException sqlexception2 ) 97 { 98 JOptionPane.showMessageDialog( null, 99 sqlexception2.getmessage(), "Database error", 100 JOptionPane.ERROR_MESSAGE ); // ensure database connection is closed 103 tablemodel.disconnectfromdatabase(); System.exit( 1 ); // terminate application 106 } // end inner catch 107 } // end outer catch 108 } // end actionperformed 109 } // end ActionListener inner class 110 ); // end call to addactionlistener setsize( 500, 250 ); // set window size 113 setvisible( true ); // display window 114 } // end try 115 catch ( ClassNotFoundException classnotfound ) Ensure that the database connection is closed 64

65 116 { 117 JOptionPane.showMessageDialog( null, 118 "MySQL driver not found", "Driver not found", 119 JOptionPane.ERROR_MESSAGE ); System.exit( 1 ); // terminate application 122 } // end catch 123 catch ( SQLException sqlexception ) 124 { 125 JOptionPane.showMessageDialog( null, sqlexception.getmessage(), 126 "Database error", JOptionPane.ERROR_MESSAGE ); // ensure database connection is closed 129 tablemodel.disconnectfromdatabase(); System.exit( 1 ); // terminate application 132 } // end catch // dispose of window when user quits application (this overrides 135 // the default of HIDE_ON_CLOSE) 136 setdefaultcloseoperation( DISPOSE_ON_CLOSE ); // ensure database connection is closed when user quits application 139 addwindowlistener( 140 Ensure that the database connection is closed 65

66 141 new WindowAdapter() 142 { 143 // disconnect from database and exit when window has closed 144 public void windowclosed( WindowEvent event ) 145 { 146 tablemodel.disconnectfromdatabase(); 147 System.exit( 0 ); 148 } // end method windowclosed 149 } // end WindowAdapter inner class 150 ); // end call to addwindowlistener 151 } // end DisplayQueryResults constructor // execute application 154 public static void main( String args[] ) 155 { 156 new DisplayQueryResults(); 157 } // end main 158 } // end class DisplayQueryResults Ensure that the database connection is closed when window has closed 66

67 67

68 Stored Procedure Stored procedures Store SQL statements in a database Invoke SQL statements by programs accessing the database Interface CallableStatement Receive arguments Output parameters 68

69 Portability Tips Although the syntax for creating stored procedures differs across s database management systems, interface CallableStatement provides a uniform interface for specifying input and output parameters for stored procedures and for invoking stored procedures. According to the Java API documentation for interface CallableStatement, for maximum portability between database systems, programs should d process the update counts or ResultSets returned from a CallableStatement before obtaining the values of any output parameters. 69

70 RowSet Interface Interface RowSet Configures the database connection automatically Prepares query statements automatically Provides set methods to specify the properties needed to establish sh a connection Part of the javax.sql package Two types of RowSet Connected RowSet o Connects to database once and remain connected Disconnected RowSet o Connects to database, executes a query and then closes connection 70

71 Package javax.sql.rowset JdbcRowSet o o o Connected RowSet Wrapper around a ResultSet Scrollable and updatable by default CachedRowSet o o o o Disconnected RowSet Cache the data of ResultSet in memory Scrollable and updatable by default Serializable Can be passed between Java application o Limitation Amount of data that can be stored in memory is limited 71

72 1 // Fig : JdbcRowSetTest.java 2 // Displaying the contents of the authors table using JdbcRowSet. 3 import java.sql.resultsetmetadata; 4 import java.sql.sqlexception; 5 import javax.sql.rowset.jdbcrowset; 6 import com.sun.rowset.jdbcrowsetimpl; // Sun s JdbcRowSet implementation 7 8 public class JdbcRowSetTest 9 { 10 // JDBC driver name and database URL 11 static final String JDBC_DRIVER = "com.mysql.jdbc.driver"; 12 static final String DATABASE_URL = "jdbc:mysql://localhost/books"; 13 static final String USERNAME = "jhtp6"; 14 static final String PASSWORD = "jhtp6"; // constructor connects to database, queries database, processes 17 // results and displays results in window 18 public JdbcRowSetTest() 19 { 20 // connect to database books and query database 21 try 22 { 23 Class.forName( JDBC_DRIVER ); // load database driver class // specify properties of JdbcRowSet 26 JdbcRowSet rowset = new JdbcRowSetImpl(); 27 rowset.seturl( DATABASE_URL ); // set database URL 28 rowset.setusername( USERNAME ); // set username 29 rowset.setpassword( PASSWORD ); // set password 30 rowset.setcommand( "SELECT * FROM authors" ); // set query 31 rowset.execute(); // execute query 32 Use Sun s reference implementation of JdbcRowSet interface (JdbcRowSetImpl) to create a JdbcRowSet object Invoke JdbcRowSet method seturl to specify the database URL Invoke JdbcRowSet method setusername to specify the username Invoke JdbcRowSet method setusername to specify the password Invoke JdbcRowSet method setcommand to specify the query ΠΠΜ 500: Προχωρημένη Ανάπτυξη Λογισμικού Εφαρμογών Invoke Μηχανικής JdbcRowSet method execute to execute the query 72

73 33 // process query results 34 ResultSetMetaData metadata = rowset.getmetadata(); 35 int numberofcolumns = metadata.getcolumncount(); 36 System.out.println( "Authors Table of Books Database:" ); // display rowset header 39 for ( int i = 1; i <= numberofcolumns; i++ ) 40 System.out.printf( "%-8s\t", metadata.getcolumnname( i ) ); 41 System.out.println(); // display each row 44 while ( rowset.next() ) 45 { 46 for ( int i = 1; i <= numberofcolumns; i++ ) 47 System.out.printf( "%-8s\t", rowset.getobject( i ) ); 48 System.out.println(); 49 } // end while 50 } // end try 51 catch ( SQLException sqlexception ) 52 { 53 sqlexception.printstacktrace(); 54 System.exit( 1 ); 55 } // end catch 56 catch ( ClassNotFoundException classnotfound ) 57 { 58 classnotfound.printstacktrace(); 59 System.exit( 1 ); 60 } // end catch 61 } // end DisplayAuthors constructor 62 73

74 63 // launch the application 64 public static void main( String args[] ) 65 { 66 JdbcRowSetTest window = new JdbcRowSetTest(); 67 } // end main 68 } // end class JdbcRowSetTest Authors Table of Books Database: authorid firstname lastname 1 Harvey Deitel 2 Paul Deitel 3 Tem Nieto 4 Sean Santry 74

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο JDBC JDBC is a set of classes and interfaces written in Java that allows Java programs to send SQL statements to a database like Oracle JDBC

Διαβάστε περισσότερα

Προγραμματισμός ΙΙ (Java) 6. Διαχείριση δεδομένων

Προγραμματισμός ΙΙ (Java) 6. Διαχείριση δεδομένων Προγραμματισμός ΙΙ (Java) 6. Διαχείριση δεδομένων Σχεσιακές Βάσεις Δεδομένων Τα δεδομένα μας οργανώνονται σε ένα ή περισσότερους πίνακες: σε στήλες και σειρές Κάθε πίνακας έχει ένα όνομα και αποτελείται

Διαβάστε περισσότερα

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο Procedures and Functions Stored procedures and functions are named blocks of code that enable you to group and organize a series of SQL and PL/SQL

Διαβάστε περισσότερα

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο Oracle SQL Developer An Oracle Database stores and organizes information. Oracle SQL Developer is a tool for accessing and maintaining the data

Διαβάστε περισσότερα

MySQL + Γλώσσα Προγραμματισμού. Βάσεις Δεδομένων 2013-2014 Ευαγγελία Πιτουρά 1

MySQL + Γλώσσα Προγραμματισμού. Βάσεις Δεδομένων 2013-2014 Ευαγγελία Πιτουρά 1 MySQL + Γλώσσα Προγραμματισμού Ευαγγελία Πιτουρά 1 Database drivers Για να χρησιμοποιήσουμε μια βάση δεδομένων από μια γλώσσα προγραμματισμού χρειαζόμαστε έναν driver. JDBC είναι το API για τη Java και

Διαβάστε περισσότερα

Instruction Execution Times

Instruction Execution Times 1 C Execution Times InThisAppendix... Introduction DL330 Execution Times DL330P Execution Times DL340 Execution Times C-2 Execution Times Introduction Data Registers This appendix contains several tables

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial Introduction Το Javadoc είναι ένα εργαλείο που παράγει αρχεία html (παρόμοιο με τις σελίδες στη διεύθυνση http://docs.oracle.com/javase/8/docs/api/index.html) από τα σχόλια

Διαβάστε περισσότερα

MySQL + Γλώσσα Προγραμματισμού. Βάσεις Δεδομένων Ευαγγελία Πιτουρά 1

MySQL + Γλώσσα Προγραμματισμού. Βάσεις Δεδομένων Ευαγγελία Πιτουρά 1 MySQL + Γλώσσα Προγραμματισμού Ευαγγελία Πιτουρά 1 Database drivers Για να χρησιμοποιήσουμε μια βάση δεδομένων από μια γλώσσα προγραμματισμού χρειαζόμαστε έναν driver. JDBC είναι το API για τη Java και

Διαβάστε περισσότερα

(C) 2010 Pearson Education, Inc. All rights reserved.

(C) 2010 Pearson Education, Inc. All rights reserved. Connectionless transmission with datagrams. Connection-oriented transmission is like the telephone system You dial and are given a connection to the telephone of fthe person with whom you wish to communicate.

Διαβάστε περισσότερα

Δομές Δεδομένων - Εργαστήριο 2. Λίστες

Δομές Δεδομένων - Εργαστήριο 2. Λίστες Λίστες Λίστες (Lists) : Συλλογή δεδομένων σε δυναμικά δεσμευμένους κόμβους. Κάθε κόμβος περιέχει συνδέσεις προς άλλους κόμβους. Προσπέλαση -στού κόμβου διατρέχοντας όλους τους προηγούμενους. Πολλές παραλλαγές

Διαβάστε περισσότερα

CYTA Cloud Server Set Up Instructions

CYTA Cloud Server Set Up Instructions CYTA Cloud Server Set Up Instructions ΕΛΛΗΝΙΚΑ ENGLISH Initial Set-up Cloud Server To proceed with the initial setup of your Cloud Server first login to the Cyta CloudMarketPlace on https://cloudmarketplace.cyta.com.cy

Διαβάστε περισσότερα

Αντικειμενοστρεφής Προγραμματισμός

Αντικειμενοστρεφής Προγραμματισμός Πανεπιστήμιο Πειραιά Τμήμα Ψηφιακών Συστημάτων Αντικειμενοστρεφής Προγραμματισμός 30/5/2016 Δρ. Ανδριάνα Πρέντζα Αναπληρώτρια Καθηγήτρια aprentza@unipi.gr Συλλογή απορριμμάτων Συλλογή απορριμμάτων (Garbage

Διαβάστε περισσότερα

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά. Διαστημικό εστιατόριο του (Μ)ΑστροΈκτορα Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά. Μόλις μια παρέα πελατών κάτσει σε ένα

Διαβάστε περισσότερα

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade Για να ελέγξετε το λογισμικό που έχει τώρα η συσκευή κάντε κλικ Menu > Options > Device > About Device Versions. Στο πιο κάτω παράδειγμα η συσκευή έχει έκδοση λογισμικού 6.0.0.546 με πλατφόρμα 6.6.0.207.

Διαβάστε περισσότερα

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ Ενότητα 12: Συνοπτική Παρουσίαση Ανάπτυξης Κώδικα με το Matlab Σαμαράς Νικόλαος Άδειες Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται σε άδειες χρήσης Creative Commons.

Διαβάστε περισσότερα

SOAP API. https://bulksmsn.gr. Table of Contents

SOAP API. https://bulksmsn.gr. Table of Contents SOAP API https://bulksmsn.gr Table of Contents Send SMS...2 Query SMS...3 Multiple Query SMS...4 Credits...5 Save Contact...5 Delete Contact...7 Delete Message...8 Email: sales@bulksmsn.gr, Τηλ: 211 850

Διαβάστε περισσότερα

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony Ελληνικά Ι English 1/7 Δημιουργία Λογαριασμού Διαχείρισης Επιχειρηματικής Τηλεφωνίας μέσω της ιστοσελίδας

Διαβάστε περισσότερα

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι

department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι She selects the option. Jenny starts with the al listing. This has employees listed within She drills down through the employee. The inferred ER sttricture relates this to the redcords in the databasee

Διαβάστε περισσότερα

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 5: Component Adaptation Environment (COPE)

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 5: Component Adaptation Environment (COPE) EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 5: Component Adaptation Environment (COPE) Performing Static Analysis 1 Class Name: The fully qualified name of the specific class Type: The type of the class

Διαβάστε περισσότερα

ΠΑΝΔΠΙΣΗΜΙΟ ΜΑΚΔΓΟΝΙΑ ΠΡΟΓΡΑΜΜΑ ΜΔΣΑΠΣΤΥΙΑΚΧΝ ΠΟΤΓΧΝ ΣΜΗΜΑΣΟ ΔΦΑΡΜΟΜΔΝΗ ΠΛΗΡΟΦΟΡΙΚΗ

ΠΑΝΔΠΙΣΗΜΙΟ ΜΑΚΔΓΟΝΙΑ ΠΡΟΓΡΑΜΜΑ ΜΔΣΑΠΣΤΥΙΑΚΧΝ ΠΟΤΓΧΝ ΣΜΗΜΑΣΟ ΔΦΑΡΜΟΜΔΝΗ ΠΛΗΡΟΦΟΡΙΚΗ ΠΑΝΔΠΙΣΗΜΙΟ ΜΑΚΔΓΟΝΙΑ ΠΡΟΓΡΑΜΜΑ ΜΔΣΑΠΣΤΥΙΑΚΧΝ ΠΟΤΓΧΝ ΣΜΗΜΑΣΟ ΔΦΑΡΜΟΜΔΝΗ ΠΛΗΡΟΦΟΡΙΚΗ ΑΝΑΠΣΤΞΗ ΓΤΝΑΜΙΚΗ ΙΣΟΔΛΙΓΑ ΓΙΑ ΣΟ ΓΔΝΙΚΟ ΚΑΣΑΣΗΜΑ ΚΡΑΣΗΗ ΓΡΔΒΔΝΧΝ ΜΔ ΣΗ ΒΟΗΘΔΙΑ PHP MYSQL Γηπισκαηηθή Δξγαζία ηνπ Υξήζηνπ

Διαβάστε περισσότερα

PortSip Softphone. Ελληνικά Ι English 1/20

PortSip Softphone. Ελληνικά Ι English 1/20 PortSip Softphone Ελληνικά Ι English 1/20 1. Περιεχόμενα 2. Εγκατάσταση σε Smartphone & Tablet (Android ή ios)... 1 3. Εγκατάσταση σε ηλεκτρονικό υπολογιστή (Windows ή Mac).... 5 4. Installation in Smartphone

Διαβάστε περισσότερα

The Simply Typed Lambda Calculus

The Simply Typed Lambda Calculus Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and

Διαβάστε περισσότερα

Homework 3 Solutions

Homework 3 Solutions Homework 3 Solutions Igor Yanovsky (Math 151A TA) Problem 1: Compute the absolute error and relative error in approximations of p by p. (Use calculator!) a) p π, p 22/7; b) p π, p 3.141. Solution: For

Διαβάστε περισσότερα

. Εργαστήριο Βάσεων Δεδομένων. Triggers

. Εργαστήριο Βάσεων Δεδομένων. Triggers Εργαστήριο Βάσεων Δεδομένων Triggers Triggers: Βασικές Έννοιες Ένας trigger είναι ένα κομμάτι κώδικα, μια ρουτίνα Συνδέεται με ένα συγκεκριμένο πίνακα Καλείται όταν συμβεί ένα γεγονός στον πίνακα Συχνές

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Αν κάπου κάνετε κάποιες υποθέσεις να αναφερθούν στη σχετική ερώτηση. Όλα τα αρχεία που αναφέρονται στα προβλήματα βρίσκονται στον ίδιο φάκελο με το εκτελέσιμο

Διαβάστε περισσότερα

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible. B-Trees Index files can become quite large for large main files Indices on index files are possible 3 rd -level index 2 nd -level index 1 st -level index Main file 1 The 1 st -level index consists of pairs

Διαβάστε περισσότερα

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook Βήμα 1: Step 1: Βρείτε το βιβλίο που θα θέλατε να αγοράσετε και πατήστε Add to Cart, για να το προσθέσετε στο καλάθι σας. Αυτόματα θα

Διαβάστε περισσότερα

Test Data Management in Practice

Test Data Management in Practice Problems, Concepts, and the Swisscom Test Data Organizer Do you have issues with your legal and compliance department because test environments contain sensitive data outsourcing partners must not see?

Διαβάστε περισσότερα

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016 Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Dynamic types, Lambda calculus machines Apr 21 22, 2016 1 Dynamic types and contracts (a) To make sure you understand the

Διαβάστε περισσότερα

EE512: Error Control Coding

EE512: Error Control Coding EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3

Διαβάστε περισσότερα

Modbus basic setup notes for IO-Link AL1xxx Master Block

Modbus basic setup notes for IO-Link AL1xxx Master Block n Modbus has four tables/registers where data is stored along with their associated addresses. We will be using the holding registers from address 40001 to 49999 that are R/W 16 bit/word. Two tables that

Διαβάστε περισσότερα

Αντικειμενοστρεφής Προγραμματισμός

Αντικειμενοστρεφής Προγραμματισμός Πανεπιστήμιο Πειραιά Τμήμα Ψηφιακών Συστημάτων Αντικειμενοστρεφής Προγραμματισμός 3/4/2017 Δρ. Ανδριάνα Πρέντζα Αναπληρώτρια Καθηγήτρια aprentza@unipi.gr Γιατί έλεγχος πρόσβασης? Προστασία ιδιωτικής πληροφορίας

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011

ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011 Διάρκεια Διαγωνισμού: 3 ώρες Απαντήστε όλες τις ερωτήσεις Μέγιστο Βάρος (20 Μονάδες) Δίνεται ένα σύνολο από N σφαιρίδια τα οποία δεν έχουν όλα το ίδιο βάρος μεταξύ τους και ένα κουτί που αντέχει μέχρι

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2 ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ Βάσεις Δεδομένων (4 ο εξάμηνο) Εργαστήριο MySQL #2 Διδάσκων: Γιάννης Θεοδωρίδης Συντάκτης Κειμένου: Βαγγέλης Κατσικάρος Φεβρουάριος 2008 Περιεχόμενα SQL Language

Διαβάστε περισσότερα

ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΝΟΣΗΛΕΥΤΙΚΗΣ

ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΝΟΣΗΛΕΥΤΙΚΗΣ ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΝΟΣΗΛΕΥΤΙΚΗΣ ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ ΨΥΧΟΛΟΓΙΚΕΣ ΕΠΙΠΤΩΣΕΙΣ ΣΕ ΓΥΝΑΙΚΕΣ ΜΕΤΑ ΑΠΟ ΜΑΣΤΕΚΤΟΜΗ ΓΕΩΡΓΙΑ ΤΡΙΣΟΚΚΑ Λευκωσία 2012 ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΣΧΟΛΗ ΕΠΙΣΤΗΜΩΝ

Διαβάστε περισσότερα

Special edition of the Technical Chamber of Greece on Video Conference Services on the Internet, 2000 NUTWBCAM

Special edition of the Technical Chamber of Greece on Video Conference Services on the Internet, 2000 NUTWBCAM NUTWBCAM A.S. DRIGAS Applied Technologies Department NCSR DEMOKRITOS Ag. Paraskevi GREECE dr@imm.demokritos.gr http://imm.demokritos.gr Το NutWBCam είναι ένα RealVideo πρόγραµµα που σας δίνει τη δυνατότητα

Διαβάστε περισσότερα

Block Ciphers Modes. Ramki Thurimella

Block Ciphers Modes. Ramki Thurimella Block Ciphers Modes Ramki Thurimella Only Encryption I.e. messages could be modified Should not assume that nonsensical messages do no harm Always must be combined with authentication 2 Padding Must be

Διαβάστε περισσότερα

SPEEDO AQUABEAT. Specially Designed for Aquatic Athletes and Active People

SPEEDO AQUABEAT. Specially Designed for Aquatic Athletes and Active People SPEEDO AQUABEAT TM Specially Designed for Aquatic Athletes and Active People 1 2 Decrease Volume Increase Volume Reset EarphonesUSBJack Power Off / Rewind Power On / Fast Forward Goggle clip LED Status

Διαβάστε περισσότερα

Αποτελεί ισχυρό εργαλείο, µε υψηλή απόδοση & αποτελεσµατικότητα.

Αποτελεί ισχυρό εργαλείο, µε υψηλή απόδοση & αποτελεσµατικότητα. Κατανεµηµένα Συστήµατα ΙΙ 2008-0909 Hibernate Lecture Κλεοπάτρα Χατζηπρίµου (chatzipr@ceid.upatras.gr) Τι είναι το Hibernate?(1/3) Ένα τυπικό Java Application αποτελείται από δύο ειδών objects: transient

Διαβάστε περισσότερα

ιαδικτυακές Εφαρµογές

ιαδικτυακές Εφαρµογές ιαδικτυακές Εφαρµογές µε Java2 Στοιχεία ικτυακής Επικοινωνίας Όροι IP address 32bit αριθµός που χρησιµοποιείται από το Internet Protocol για την παράδοση δεδοµένων στο σωστό υπολογιστή στο δίκτυο. Port

Διαβάστε περισσότερα

Approximation of distance between locations on earth given by latitude and longitude

Approximation of distance between locations on earth given by latitude and longitude Approximation of distance between locations on earth given by latitude and longitude Jan Behrens 2012-12-31 In this paper we shall provide a method to approximate distances between two points on earth

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006 ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/26 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι το 1 εκτός αν ορίζεται διαφορετικά στη διατύπωση

Διαβάστε περισσότερα

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Συστήματα Διαχείρισης Βάσεων Δεδομένων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 9: Transactions - part 1 Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών Tutorial on Undo, Redo and Undo/Redo

Διαβάστε περισσότερα

Other Test Constructions: Likelihood Ratio & Bayes Tests

Other Test Constructions: Likelihood Ratio & Bayes Tests Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :

Διαβάστε περισσότερα

5. Ανασκόπηση αντικειμενοστραφούς προγραμματισμού

5. Ανασκόπηση αντικειμενοστραφούς προγραμματισμού 5. Ανασκόπηση αντικειμενοστραφούς προγραμματισμού Χειμερινό εξάμηνο 2013 Πέτρος Κωμοδρόμος komodromos@ucy.ac.cy http://www.eng.ucy.ac.cy/petros 1 Θέματα Αντικειμενοστραφής προγραμματισμός Τάξεις (classes)

Διαβάστε περισσότερα

2 Composition. Invertible Mappings

2 Composition. Invertible Mappings Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,

Διαβάστε περισσότερα

Αποθηκευμένες Διαδικασίες Stored Routines (Procedures & Functions)

Αποθηκευμένες Διαδικασίες Stored Routines (Procedures & Functions) Αποθηκευμένες Διαδικασίες Stored Routines (Procedures & Functions) Αυγερινός Αραμπατζής avi@ee.duth.gr www.aviarampatzis.com Βάσεις Δεδομένων Stored Procedures 1 Stored Routines (1/2) Τμήματα κώδικα τα

Διαβάστε περισσότερα

derivation of the Laplacian from rectangular to spherical coordinates

derivation of the Laplacian from rectangular to spherical coordinates derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used

Διαβάστε περισσότερα

10 η Διάλεξη Python Βάσεις δεδομένων στη python

10 η Διάλεξη Python Βάσεις δεδομένων στη python 10 η Διάλεξη Python Βάσεις δεδομένων στη python ΒΑΣΕΙΣ ΔΕΔΟΜΕΝΩΝ Η standard διεπαφη της python για βάσεις δεδομένων βασίζεται στο DB-API Python Database API υποστηρίζει ένα ευρύ φάσμα βάσεων δεδομένων

Διαβάστε περισσότερα

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required) Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts

Διαβάστε περισσότερα

, Evaluation of a library against injection attacks

, Evaluation of a library against injection attacks THE INSTITUTE OF ELECTRONICS, INFMATION AND COMMUNICATION ENGINEERS TECHNICAL REPT OF IEICE., () 211 8588 4 1 1 221 0835 2 14 1 E-mail: okubo@jp.fujitsu.com, tanaka@iisec.ac.jp Web,,,, Evaluation of a

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Όλοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι του 10000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Αν κάπου κάνετε κάποιες υποθέσεις

Διαβάστε περισσότερα

ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ

ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ Σε ένα πρόγραμμα κατά την εκτέλεση του ένα ερώτημα SQL μπορεί δυναμικά να παίρνει διαφορετικές παραμέτρους μπορεί να πάρει πολλές παραμέτρους oι παράμετροι δηλώνονται με? Στις παραμέτρους

Διαβάστε περισσότερα

Ψηφιακή ανάπτυξη. Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS

Ψηφιακή ανάπτυξη. Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS Ψηφιακή ανάπτυξη Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS Learning Objective : Βασικά συστατικά του Web Fabio Calefato Department of

Διαβάστε περισσότερα

Business English. Ενότητα # 9: Financial Planning. Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων

Business English. Ενότητα # 9: Financial Planning. Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ Ανώτατο Εκπαιδευτικό Ίδρυμα Πειραιά Τεχνολογικού Τομέα Business English Ενότητα # 9: Financial Planning Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων Άδειες Χρήσης Το παρόν εκπαιδευτικό

Διαβάστε περισσότερα

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής

Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής Να γραφεί πρόγραμμα το οποίο δέχεται ως είσοδο μια ακολουθία S από n (n 40) ακέραιους αριθμούς και επιστρέφει ως έξοδο δύο ακολουθίες από θετικούς ακέραιους

Διαβάστε περισσότερα

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =

Διαβάστε περισσότερα

TMA4115 Matematikk 3

TMA4115 Matematikk 3 TMA4115 Matematikk 3 Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet Trondheim Spring 2010 Lecture 12: Mathematics Marvellous Matrices Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet

Διαβάστε περισσότερα

Αντικειμενοστρεφής Προγραμματισμός

Αντικειμενοστρεφής Προγραμματισμός Πανεπιστήμιο Πειραιά Τμήμα Ψηφιακών Συστημάτων Αντικειμενοστρεφής Προγραμματισμός 23/4/2018 Δρ. Ανδριάνα Πρέντζα Αναπληρώτρια Καθηγήτρια aprentza@unipi.gr Υπερφόρτωση μεθόδων Υπερφόρτωση μεθόδων Πολλαπλές

Διαβάστε περισσότερα

VBA ΣΤΟ WORD. 1. Συχνά, όταν ήθελα να δώσω ένα φυλλάδιο εργασίας με ασκήσεις στους μαθητές έκανα το εξής: Version 25-7-2015 ΗΜΙΤΕΛΗΣ!!!!

VBA ΣΤΟ WORD. 1. Συχνά, όταν ήθελα να δώσω ένα φυλλάδιο εργασίας με ασκήσεις στους μαθητές έκανα το εξής: Version 25-7-2015 ΗΜΙΤΕΛΗΣ!!!! VBA ΣΤΟ WORD Version 25-7-2015 ΗΜΙΤΕΛΗΣ!!!! Μου παρουσιάστηκαν δύο θέματα. 1. Συχνά, όταν ήθελα να δώσω ένα φυλλάδιο εργασίας με ασκήσεις στους μαθητές έκανα το εξής: Εγραφα σε ένα αρχείο του Word τις

Διαβάστε περισσότερα

Démographie spatiale/spatial Demography

Démographie spatiale/spatial Demography ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΙΑΣ Démographie spatiale/spatial Demography Session 1: Introduction to spatial demography Basic concepts Michail Agorastakis Department of Planning & Regional Development Άδειες Χρήσης

Διαβάστε περισσότερα

Ψηφιακή ανάπτυξη. Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS

Ψηφιακή ανάπτυξη. Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS Ψηφιακή ανάπτυξη Course Unit #1 : Κατανοώντας τις βασικές σύγχρονες ψηφιακές αρχές Thematic Unit #1 : Τεχνολογίες Web και CMS Learning Objective : SEO και Analytics Fabio Calefato Department of Computer

Διαβάστε περισσότερα

TaxiCounter Android App. Περδίκης Ανδρέας ME10069

TaxiCounter Android App. Περδίκης Ανδρέας ME10069 TaxiCounter Android App Περδίκης Ανδρέας ME10069 Content Android Operating System Development Tools Taxi Counter Algorithm Design Development Process Android Operating System Android is a Linux-based operating

Διαβάστε περισσότερα

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Συνάρτηση round() Περιγραφή Η συνάρτηση ROUND στρογγυλοποιεί έναν αριθμό στον δεδομένο

Διαβάστε περισσότερα

How to register an account with the Hellenic Community of Sheffield.

How to register an account with the Hellenic Community of Sheffield. How to register an account with the Hellenic Community of Sheffield. (1) EN: Go to address GR: Πηγαίνετε στη διεύθυνση: http://www.helleniccommunityofsheffield.com (2) EN: At the bottom of the page, click

Διαβάστε περισσότερα

Partial Trace and Partial Transpose

Partial Trace and Partial Transpose Partial Trace and Partial Transpose by José Luis Gómez-Muñoz http://homepage.cem.itesm.mx/lgomez/quantum/ jose.luis.gomez@itesm.mx This document is based on suggestions by Anirban Das Introduction This

Διαβάστε περισσότερα

Assalamu `alaikum wr. wb.

Assalamu `alaikum wr. wb. LUMP SUM Assalamu `alaikum wr. wb. LUMP SUM Wassalamu alaikum wr. wb. Assalamu `alaikum wr. wb. LUMP SUM Wassalamu alaikum wr. wb. LUMP SUM Lump sum lump sum lump sum. lump sum fixed price lump sum lump

Διαβάστε περισσότερα

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch: HOMEWORK 4 Problem a For the fast loading case, we want to derive the relationship between P zz and λ z. We know that the nominal stress is expressed as: P zz = ψ λ z where λ z = λ λ z. Therefore, applying

Διαβάστε περισσότερα

Εργαστήριο 9. Styling with Javascript

Εργαστήριο 9. Styling with Javascript Εργαστήριο 9 Styling with Javascript Pimp my Text with Javascript Today you'll write a page where the user can type text into a box, and by clicking on UI controls, the user can "pimp out" the text by

Διαβάστε περισσότερα

C.S. 430 Assignment 6, Sample Solutions

C.S. 430 Assignment 6, Sample Solutions C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order

Διαβάστε περισσότερα

Galatia SIL Keyboard Information

Galatia SIL Keyboard Information Galatia SIL Keyboard Information Keyboard ssignments The main purpose of the keyboards is to provide a wide range of keying options, so many characters can be entered in multiple ways. If you are typing

Διαβάστε περισσότερα

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

Main source: Discrete-time systems and computer control by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1 Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1 A Brief History of Sampling Research 1915 - Edmund Taylor Whittaker (1873-1956) devised a

Διαβάστε περισσότερα

Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3. Prepared by Costantinos Costa Edited by George Nikolaides. EPL 451 - Data Mining on the Web

Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3. Prepared by Costantinos Costa Edited by George Nikolaides. EPL 451 - Data Mining on the Web EPL 451 - Data Mining on the Web Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3 Prepared by Costantinos Costa Edited by George Nikolaides Semester Project Microsoft Malware Classification Challenge (BIG 2015) More info:

Διαβάστε περισσότερα

Example Sheet 3 Solutions

Example Sheet 3 Solutions Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note

Διαβάστε περισσότερα

ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ "ΠΟΛΥΚΡΙΤΗΡΙΑ ΣΥΣΤΗΜΑΤΑ ΛΗΨΗΣ ΑΠΟΦΑΣΕΩΝ. Η ΠΕΡΙΠΤΩΣΗ ΤΗΣ ΕΠΙΛΟΓΗΣ ΑΣΦΑΛΙΣΤΗΡΙΟΥ ΣΥΜΒΟΛΑΙΟΥ ΥΓΕΙΑΣ "

ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ ΠΟΛΥΚΡΙΤΗΡΙΑ ΣΥΣΤΗΜΑΤΑ ΛΗΨΗΣ ΑΠΟΦΑΣΕΩΝ. Η ΠΕΡΙΠΤΩΣΗ ΤΗΣ ΕΠΙΛΟΓΗΣ ΑΣΦΑΛΙΣΤΗΡΙΟΥ ΣΥΜΒΟΛΑΙΟΥ ΥΓΕΙΑΣ ΤΕΧΝΟΛΟΓΙΚΟ ΕΚΠΑΙΔΕΥΤΙΚΟ ΙΔΡΥΜΑ ΚΑΛΑΜΑΤΑΣ ΣΧΟΛΗ ΔΙΟΙΚΗΣΗΣ ΟΙΚΟΝΟΜΙΑΣ ΤΜΗΜΑ ΜΟΝΑΔΩΝ ΥΓΕΙΑΣ ΚΑΙ ΠΡΟΝΟΙΑΣ ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ "ΠΟΛΥΚΡΙΤΗΡΙΑ ΣΥΣΤΗΜΑΤΑ ΛΗΨΗΣ ΑΠΟΦΑΣΕΩΝ. Η ΠΕΡΙΠΤΩΣΗ ΤΗΣ ΕΠΙΛΟΓΗΣ ΑΣΦΑΛΙΣΤΗΡΙΟΥ ΣΥΜΒΟΛΑΙΟΥ

Διαβάστε περισσότερα

UNIVERSITY OF CALIFORNIA. EECS 150 Fall ) You are implementing an 4:1 Multiplexer that has the following specifications:

UNIVERSITY OF CALIFORNIA. EECS 150 Fall ) You are implementing an 4:1 Multiplexer that has the following specifications: UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences EECS 150 Fall 2001 Prof. Subramanian Midterm II 1) You are implementing an 4:1 Multiplexer that has the following specifications:

Διαβάστε περισσότερα

Οδηγίες χρήσης. Registered. Οδηγίες ένταξης σήματος D-U-N-S Registered στην ιστοσελίδα σας και χρήσης του στην ηλεκτρονική σας επικοινωνία

Οδηγίες χρήσης. Registered. Οδηγίες ένταξης σήματος D-U-N-S Registered στην ιστοσελίδα σας και χρήσης του στην ηλεκτρονική σας επικοινωνία Οδηγίες χρήσης υλικού D-U-N-S Registered Οδηγίες ένταξης σήματος D-U-N-S Registered στην ιστοσελίδα σας και χρήσης του στην ηλεκτρονική σας επικοινωνία Οδηγίες χρήσης υλικού D-U-N-S Για οποιαδήποτε ερώτηση

Διαβάστε περισσότερα

Αρχές Τεχνολογίας Λογισμικού Εργαστήριο

Αρχές Τεχνολογίας Λογισμικού Εργαστήριο Αρχές Τεχνολογίας Λογισμικού Εργαστήριο Κωδικός Μαθήματος: TP323 Ώρες Εργαστηρίου: 2/εβδομάδα (Διαφάνειες Νίκου Βιδάκη) 1 JAVA Inheritance Εβδομάδα Νο. 3 2 Προηγούμενο μάθημα (1/2) Τι είναι αντικείμενο?

Διαβάστε περισσότερα

Βασίλης Χριστοφίδης Επαναληπτική Εξέταση (3 ώρες) Ηµεροµηνία: 21 Σεπτεµβρίου 2012

Βασίλης Χριστοφίδης Επαναληπτική Εξέταση (3 ώρες) Ηµεροµηνία: 21 Σεπτεµβρίου 2012 Πανεπιστήµιο Κρήτης Τµήµα Επιστήµης Υπολογιστών ΗΥ-252 Αντικειµενοστρεφής Προγραµµατισµός Βασίλης Χριστοφίδης Επαναληπτική Εξέταση (3 ώρες) Ηµεροµηνία: 21 Σεπτεµβρίου 2012 Θέμα 1 Θέμα 2 Θέμα 3 Θέμα 4 Θέμα

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα είναι μικρότεροι το 1000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Διάρκεια: 3,5 ώρες Καλή

Διαβάστε περισσότερα

the total number of electrons passing through the lamp.

the total number of electrons passing through the lamp. 1. A 12 V 36 W lamp is lit to normal brightness using a 12 V car battery of negligible internal resistance. The lamp is switched on for one hour (3600 s). For the time of 1 hour, calculate (i) the energy

Διαβάστε περισσότερα

Συντακτικές λειτουργίες

Συντακτικές λειτουργίες 2 Συντακτικές λειτουργίες (Syntactic functions) A. Πτώσεις και συντακτικές λειτουργίες (Cases and syntactic functions) The subject can be identified by asking ποιος (who) or τι (what) the sentence is about.

Διαβάστε περισσότερα

Διδάσκων: Παναγιώτης Ανδρέου

Διδάσκων: Παναγιώτης Ανδρέου Διάλεξη 7: Ενθυλάκωση (encapsulation), Τροποποιητές(modifiers) Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: - Ενθυλάκωση -Τροποποιητές Πρόσβασης (Access Modifiers), public, protected, private,

Διαβάστε περισσότερα

Math 6 SL Probability Distributions Practice Test Mark Scheme

Math 6 SL Probability Distributions Practice Test Mark Scheme Math 6 SL Probability Distributions Practice Test Mark Scheme. (a) Note: Award A for vertical line to right of mean, A for shading to right of their vertical line. AA N (b) evidence of recognizing symmetry

Διαβάστε περισσότερα

Περιγραφή της εργασίας

Περιγραφή της εργασίας Προγραμματισμός Internet Εξάμηνο: Χειμερινό 2006-2007 Εργασία Εργαστηρίου Δευτέρα 11 Δεκ. 2006 Περιγραφή της εργασίας Μία εταιρία ηλεκτρονικού εμπορίου εμπορεύεται βιβλία πληροφορικής μέσω διαδικτύου.

Διαβάστε περισσότερα

Managing Information.! Lecturer: N. Kyritsis, MBA, Ph.D. Candidate Athens University of Economics and Business!! e-mail: kyritsis@ist.edu.

Managing Information.! Lecturer: N. Kyritsis, MBA, Ph.D. Candidate Athens University of Economics and Business!! e-mail: kyritsis@ist.edu. Managing Information! Lecturer: N. Kyritsis, MBA, Ph.D. Candidate Athens University of Economics and Business!! e-mail: kyritsis@ist.edu.gr Database Management Database Definition Collection of relevant

Διαβάστε περισσότερα

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0. DESIGN OF MACHINERY SOLUTION MANUAL -7-1! PROBLEM -7 Statement: Design a double-dwell cam to move a follower from to 25 6, dwell for 12, fall 25 and dwell for the remader The total cycle must take 4 sec

Διαβάστε περισσότερα

ΟΙΚΟΝΟΜΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΑΘΗΝΩΝ ΤΜΗΜΑ ΔΙΟΙΚΗΤΙΚΗΣ ΕΠΙΣΤΗΜΗΣ ΚΑΙ ΤΕΧΝΟΛΟΓΙΑΣ. Τεχνολογίες και Εφαρμογές Διαδικτύου. Σχεδίαση Συστήματος

ΟΙΚΟΝΟΜΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΑΘΗΝΩΝ ΤΜΗΜΑ ΔΙΟΙΚΗΤΙΚΗΣ ΕΠΙΣΤΗΜΗΣ ΚΑΙ ΤΕΧΝΟΛΟΓΙΑΣ. Τεχνολογίες και Εφαρμογές Διαδικτύου. Σχεδίαση Συστήματος ΟΙΚΟΝΟΜΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΑΘΗΝΩΝ ΤΜΗΜΑ ΔΙΟΙΚΗΤΙΚΗΣ ΕΠΙΣΤΗΜΗΣ ΚΑΙ ΤΕΧΝΟΛΟΓΙΑΣ Σχεδίαση Συστήματος Κατερίνα Πραματάρη Διαφορετικοί τύποι έργων ανάπτυξης λογισμικού Μικρή εφαρμογή, ανάπτυξη από την αρχή, σχετικά

Διαβάστε περισσότερα

Strain gauge and rosettes

Strain gauge and rosettes Strain gauge and rosettes Introduction A strain gauge is a device which is used to measure strain (deformation) on an object subjected to forces. Strain can be measured using various types of devices classified

Διαβάστε περισσότερα

Διαδίκτυο των Αντικειμένων - IoT.

Διαδίκτυο των Αντικειμένων - IoT. Διαδίκτυο των Αντικειμένων - IoT sdima@ece.upatras.gr ΑΠΟΚΤΗΣΗ ΑΚΑΔΗΜΑΪΚΗΣ ΔΙΔΑΚΤΙΚΗΣ ΕΜΠΕΙΡΙΑΣ ΣΕ ΝΕΟΥΣ ΕΠΙΣΤΗΜΟΝΕΣ ΚΑΤΟΧΟΥΣ ΔΙΔΑΚΤΟΡΙΚΟΥ ΣΤΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ (ΦΚ/MIS) Ε.655/ 5001184. sdima@ece.upatras.gr

Διαβάστε περισσότερα

Capacitors - Capacitance, Charge and Potential Difference

Capacitors - Capacitance, Charge and Potential Difference Capacitors - Capacitance, Charge and Potential Difference Capacitors store electric charge. This ability to store electric charge is known as capacitance. A simple capacitor consists of 2 parallel metal

Διαβάστε περισσότερα

5.4 The Poisson Distribution.

5.4 The Poisson Distribution. The worst thing you can do about a situation is nothing. Sr. O Shea Jackson 5.4 The Poisson Distribution. Description of the Poisson Distribution Discrete probability distribution. The random variable

Διαβάστε περισσότερα

Εργαστήριο Βάσεων Δεδομένων. Triggers

Εργαστήριο Βάσεων Δεδομένων. Triggers Εργαστήριο Βάσεων Δεδομένων Triggers CREATE TRIGGER Δήλωση δημιουργίας Trigger: CREATE [DEFINER = { user CURRENT_USER }] TRIGGER trigger_name trigger_time trigger_event ON tbl_name FOR EACH ROW trigger_stmt

Διαβάστε περισσότερα

Ασφάλεια σε χώρους αναψυχής: Ένα σύστημα από έξυπνα αντικείμενα

Ασφάλεια σε χώρους αναψυχής: Ένα σύστημα από έξυπνα αντικείμενα Σχολή Επικοινωνίας και Μέσων Ενημέρωσης Πτυχιακή εργασία Ασφάλεια σε χώρους αναψυχής: Ένα σύστημα από έξυπνα αντικείμενα Εύρος Χριστοδούλου Λεμεσός, Μάιος 2018 ΤΕΧΝΟΛΟΓΙΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΣΧΟΛΗ ΕΠΙΚΟΙΝΩΝΙΑΣ

Διαβάστε περισσότερα

ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ

ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ ΚΕΡΑΜΟΠΟΥΛΟΣ ΕΥΚΛΕΙΔΗΣ Τα μεταδεδομένα είναι δεδομένα για τα δεδομένα (data about data). Περιγράφουν τη δομή μίας βάσης ή ενός συγκεκριμένου τύπου δεδομένων όπως ενός αντικειμένου, ενός πίνακα. Δρ. Κεραμόπουλος

Διαβάστε περισσότερα

Δίκτυα Επικοινωνιών ΙΙ: OSPF Configuration

Δίκτυα Επικοινωνιών ΙΙ: OSPF Configuration Δίκτυα Επικοινωνιών ΙΙ: OSPF Configuration Δρ. Απόστολος Γκάμας Διδάσκων 407/80 gkamas@uop.gr Δίκτυα Επικοινωνιών ΙΙ Διαφάνεια 1 1 Dynamic Routing Configuration Router (config) # router protocol [ keyword

Διαβάστε περισσότερα

Advanced Subsidiary Unit 1: Understanding and Written Response

Advanced Subsidiary Unit 1: Understanding and Written Response Write your name here Surname Other names Edexcel GE entre Number andidate Number Greek dvanced Subsidiary Unit 1: Understanding and Written Response Thursday 16 May 2013 Morning Time: 2 hours 45 minutes

Διαβάστε περισσότερα

Τμήμα Πολιτικών και Δομικών Έργων

Τμήμα Πολιτικών και Δομικών Έργων Τμήμα Πολιτικών και Δομικών Έργων Πτυχιακή Εργασία: Τοπογραφικό διάγραμμα σε ηλεκτρονική μορφή κεντρικού λιμένα Κέρκυρας και κτιρίου νέου επιβατικού σταθμού σε τρισδιάστατη μορφή και σχεδίαση με AutoCAD

Διαβάστε περισσότερα

(Διαφάνειες Νίκου Βιδάκη)

(Διαφάνειες Νίκου Βιδάκη) (Διαφάνειες Νίκου Βιδάκη) JAVA Inheritance Εβδομάδα Νο. 3 2 Προηγούμενο μάθημα (1/2) Τι είναι αντικείμενο? Ανάλυση αντικειμένων Πραγματικά αντικείμενα Καταστάσεις Συμπεριφορές Αντικείμενα στον προγραμματισμό

Διαβάστε περισσότερα

Μηχανική Μάθηση Hypothesis Testing

Μηχανική Μάθηση Hypothesis Testing ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Μηχανική Μάθηση Hypothesis Testing Γιώργος Μπορμπουδάκης Τμήμα Επιστήμης Υπολογιστών Procedure 1. Form the null (H 0 ) and alternative (H 1 ) hypothesis 2. Consider

Διαβάστε περισσότερα