The following results are found.


How can I connect to a database in Matlab. I have a local database \'postgres\', username \'postgres\'. password \'123456\' port \'5432\' How would I know if I am being connected to the database? Thanks
 
 
 
I want to connect to a database on my local computer using php My database details are database name: 'test1' username: 'test_u' port: '22' pass: 'test_pass' Please let me know how can i do it? or what are the functions I can use? thanks
 
I have a database on the server. But i want to connect to a local database first for android apps.. lets my database name: 'abcd' username: 'efge' port: '22' pass: '123456' localhost Does anyone know how can i do it? Thanks
 
 
I have a form that has name, email, phone no. as text fields When I hit the submit button. the data should be saved to a database lets my database name: 'abcd' username: 'efge' table :'userdetails' port: '22' pass: '123456' localhost Thanks
 
i have phpmyadmin running. I already have a database 'user_db'. I want to create a table named 'user_db'. The table has two columns name, id. How can I create one? id is always an integer user_db name id Kelly 19 Sam 3 Thanks
 
 
When i run the below code, some of the data is not saved to the database..any comments? for($i=1;$i
 
 
 
 
  Introduction Java, because of the fact that it is object oriented can help develop just any kind of program.With its open source libraries, java can be used everywhere. Better still, these libraries make it easy, fast, and cost effective to develop a program.Java is platform independent. This means that one can develop an application that can be used across multiple operating systems. For example, one can develop a multi-platform program that would run in Windows, Mac OS X, and Linux as well as in browsers. Some of the amazing things that are done using Java ANDROID: Android development is mainly powered by JAVA and the SDK provided. Android programming has a lot of scope as the journey of it has just begun. Android platform provides the user a lot of control over the handset and applications can be built to perform a whole variety of tasks. For example there could be games developed for the blind to help them learn stuff which they would have learnt otherwise, if they had the power of vision or there could be an app built which could help control the electronics with the help of Arduino and internet. INTERNET BANKING: The banks have now started using Java technology to develop a customer-oriented Internet banking solution that integrates the flexibility of online services with the security necessary for critical banking transactionsJava is currently in use for the development because of the fact that the application would run on any java-enabled consumer device and therefore it endorses a Bank’s “anywhere, anytime banking” philosophy. WEB SERVER: Aweb server is the software responsible for accepting browser requests, retrieving the specified file (or executing the specified CGI, PHP, ASP script), and returning its contents (or the script's results).Web servers are mostly developed using C, for example, the Apache web server.But there are a few web servers like AssoudiWebServer which are developed using java and are equally competitive with the servers developed using C. Servlets and JSPs: Servlets and JSPs are used to create dynamic web applications with JavaA servlet is a Java class that runs in an "application server" and sends web pages back to a browser when a user somewhere in the world clicks on a URL.JSPs are another of the core building blocks of Java web applications, allowing one to combine HTML and Java seamlessly. WYSIWYG Editor: WYSIWYG(What you see is what you get) is an editor which helps people to create web pages without writing a single piece of HTML code. Microsoft FrontPage and Dreamweaver are examples of such editors. These editors are built with the help of Java using the advanced concepts like Collections Framework, Connecting to MySQL Database, Threads, Java Swing (GUI), and Sockets. Nasa World Wind: World Wind lets one to zoom from satellite altitude into any place on Earth. Leveraging Landsat satellite imagery and Shuttle Radar Topography Mission data, World Wind lets one to experience Earth terrain in visually rich 3D, just as if he/she were really there. It is very much like Google Earth, but written 100% in Java. There is an SDK for embedding it into his/her Java Swing applications. IDE for Java Programming: Eclipse, an integrated development environment used by the java programmers has been written mostly in java.
 
 
Overview of various Java versions and their features   Java SE 8 Java 8 was released on 18 March 2014. The code name culture is dropped with Java 8 and so no official code name going forward from Java 8.   New features in Java SE 8: Lambda Expressions Pipelines and Streams Date and Time API Default Methods Type Annotations Nashhorn JavaScript Engine Concurrent Accumulators Parallel operations PermGen Error Removed TLS SNI   Java Version SE 7 Code named Dolphin and released on July 28, 2011.   New features in Java SE 7: Strings in switch Statement Type Inference for Generic Instance Creation Multiple Exception Handling Support for Dynamic Languages Try with Resources Java nio Package Binary Literals, underscore in literals Diamond Syntax Automatic null Handling   Java Version SE 6 Code named Mustang and released on December 11, 2006.   New features in Java SE 6: Scripting Language Support JDBC 4.0 API Java Compiler API Pluggable Annotations Native PKI, Java GSS, Kerberos and LDAP support. Integrated Web Services. Lot more enhancements.   J2SE Version 5.0 Code named Tiger and released on September 30, 2004.   New features in J2SE 5.0: Generics Enhanced for Loop Autoboxing/Unboxing Typesafe Enums Varargs Static Import Metadata (Annotations) Instrumentation   J2SE Version 1.4 Code named Merlin and released on February 6, 2002 (first release under JCP).   New features in J2SE 1.4: XML Processing Java Print Service Logging API Java Web Start JDBC 3.0 API Assertions Preferences API Chained Exception IPv6 Support Regular Expressions Image I/O API   J2SE Version 1.3 Code named Kestrel and released on May 8, 2000.   New features in J2SE 1.3: Java Sound Jar Indexing   J2SE Version 1.2 Code named Playground and released on December 8, 1998.   New features in J2SE 1.2: Collections framework. Java String memory map for constants. Just In Time (JIT) compiler. Jar Signer for signing Java ARchive (JAR) files. Policy Tool for granting access to system resources. Java Foundation Classes (JFC) which consists of Swing 1.0, Drag and Drop, and Java 2D class libraries. Java Plug-in Scrollable result sets, BLOB, CLOB, batch update, user-defined types in JDBC. Audio support in Applets.   JDK Version 1.1 Released on February 19, 1997   New features in JDK 1.1: JDBC (Java Database Connectivity) Inner Classes Java Beans RMI (Remote Method Invocation) Reflection (introspection only)   JDK Version 1.0 Codenamed Oak and released on January 23, 1996.     KEY NEW FEATURES IN THE LATEST JAVA VERISONS     Diamond Operator Diamond operator is one of the most important features of Java 7 feature set. When we use generics and declare a map, then we need to specify the types on both the sides as shown below which was redundant, but in Java 7 we don't need to declare the types at right hand side. For example, if we have to declare a map of trades using Generics, we write the code as follows:   Before Java 7:   List al=new ArrayList();   In 7, it's written like this:   List al=new ArrayList();   We don't have to type the whole list of types for the instantiation. Instead we use the symbol, which is called diamond operator.   For example, Map trades = new TreeMap ();     Using strings in switch statements Switch statements work either with primitive types or enumerated types. Java 7 introduced another type that we can use in Switch statements: the String type. This is a very good feature as lot of times we have Strings as key to match and we often work out if-else and equals for the check. But now we can directly use Strings in switch statement, so that we can use Switch functionality to fullest.   public class JavaSevenSwitch {           public static void main(String[] args) {                     String s = "java";                     // switch allows string from java7                     switch (s) {                     case "java":                               System.out.println("This is java");                               break;                     case ".net":                               System.out.println("This is .net");                               break;                     }           } }     Automatic resource management Resources such as Connections, Files, Input/Output Streams, etc. should be closed manually by the developer by writing bog-standard code. Usually we use a try-finally block to close the respective resources.   Before Java 7:   try {   FileOutputStream fos = new FileOutputStream("file.txt");   DataOutputStream dos = new DataOutputStream(fos);     } catch (IOException e) {     } finally {   try {       } catch (IOException e) {   // log the exception } }   However, Java 7 introduced a feature to manage the resources automatically. It is simple in operation, too. All we have to do is declare the resources in the try as follows:   try (FileOutputStream fos = new FileOutputStream("file.txt"); DataOutputStream dos = new DataOutputStream(fos)) { dos.writeUTF("test");   } catch (IOException e) {   // log the exception   }     Numeric literals with underscores This is another excellent usability feature in java 7, which allows the user to add any number of underscores which can appear anywhere between the digits in a numeric literal. As shown below we are separating group of digits in numeric literals which is improving the readability of the number.   But there are some rules for adding underscores between digits.         int thousand = 1_000; int million = 1_000_000;     Improved exception handling Sometimes we need to handle lot of exceptions for which we need to have multiple catch statements, one for each exception we handle. However, in java 7 that is not the case anymore, as we can add multiple exceptions using the pipe.   Let's say we have a method that throws three exceptions. In the current state, we would deal them individually as shown in below:  //Multiple exception catch in single catch statement using "|" symbol. catch(ArithmeticException|NumberFormatException|NullPointerException|IOException e) { }  File change Notifications The long awaited and very much useful feature of notifications when a file change is done was also introduced in Java 7. When any file or directory changes, the changes or the events are notified using the API WatchService.  The steps involved in implementing the API are: Create a WatchService. This service consists of a queue to hold WatchKeys. Register the directory/file we wish to monitor with this WatchService. While registering, we specify the types of events we wish to receive (create, modify or delete events). We have to start an infinite loop to listen to events. When an event occurs, a WatchKey is placed into the queue that consumes the WatchKey and invoke queries on it.   Let's follow this via an example. We create a DirPolice Java program whose responsibility is to police a particular directory. The steps are provided below:  WatchService watchService = FileSystems.getDefault().newWatchService();  path = Paths.get("C:\\Temp\\temp\\");  These are java.nio.file.StandardWatchEventKinds event types     while(true) { WatchKey key = watchService.take(); // this would return the keys … }  for (WatchEvent event : key.pollEvents()) {  Kind kind = event.kind();  }  For example, if we modify or delete the temp directory, we would see statement as shown below on the console respectively:  Event on temp is ENTRY_MODIFY  Event on temp is ENTRY_DELETE  Fork and Join The effective use of parallel cores in a Java program has always been a challenge. There were few home-grown frameworks that would distribute the work across multiple cores and then join them to return the result set. Java 7 has incorporated this feature as a Fork and Join framework.  Basically the Fork-Join breaks the task at hand into mini-tasks until the mini-task is simple enough that it can be solved without further breakups. It’s like a divide-and-conquer algorithm. One important concept to note in this framework is that ideally no worker thread is idle. They implement a work-stealing algorithm in that idle workers “steal” the work from those workers who are busy.  The core classes supporting the Fork-Join mechanism are ForkJoinPool and ForkJoinTask. The ForkJoinPool is basically a specialized implementation of ExecutorService implementing the work-stealing algorithm we talked about above.  We create an instance of ForkJoinPool by providing the target parallelism level — the number of processors as shown below:  ForkJoinPool pool = new ForkJoinPool(numberOfProcessors) Where numberOfProcessors = Runtime.getRunTime().availableProcessors();  However, the default ForkJoinPool instantiation would set the parallelism level equal to the same number obtained as above.  The problem that needs to be solved is coded in a ForkJoinTask. However, there are two implementations of this class out of the box: the RecursiveAction and RecursiveTask. The only difference between these two classes is that the former one does not return a value while the latter returns an object of specified type.   Here’s how to create a RecursiveAction or RecursiveTask class that represents the requirement problem:   public class MyBigProblemTask extends RecursiveAction {       @Override       protected void compute() {         . . . // problem invocation goes here     } } We have to override the compute method wherein we need to provide the computing functionality. Now, provide this ForkJoinTask to the Executor by calling invoke method on the ForkJoinPool:       Supporting dynamism Java is a statically typed language — the type checking of the variables, methods and return values is performed at compile time. The JVM executes this strongly-typed bytecode at runtime without having to worry about finding the type information.  There’s another breed of typed languages — the dynamically typed languages. Ruby, Python and Clojure are in this category. The type information is unresolved until runtime in these languages. This is not possible in Java as it would not have any necessary type information.   Although it is possible to run these languages on a JVM (using Reflection), it’s not without constraints and restrictions.   In Java 7, a new feature called invokedynamic was introduced. This makes VM changes to incorporate non-Java language requirements. A new package, java.lang.invoke, consisting of classes such as MethodHandle, CallSite and others, has been created to extend the support of dynamic languages.  JLayerPane Java introduced another great feature for swing UI developer – JLayeredPane. With the use of JLayeredPane we can draw on the top of a component and handle the events without actually modifying the underlying component. This is a great feature because it can be used in many effects such as transition, blur, spotlight etc.  Binary Literals Binary literals were also introduced in the java 7 release, so developers don't have to convert them to hexadecimals any more.  Before Java 7:  But this is slow and could throw runtime exceptions.  In Java 7:  int binary = 0b101010; // Much easier  Simplified Varargs Method Invocation When a programmer tries to invoke a varargs method with a non-reifiable varargs type, the compiler currently generates an “unsafe operation” warning. JDK 7 moves the warning from the call site to the method declaration. This will enable API designers to use varargs due to the reduction of warnings reported.  Major Advantage: Safely and significantly reduces the total number of warnings reported to and suppressed by programmers.
 

    Related Videos