This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; | |
| import java.io.IOException; | |
| public class JSoupExampleOne { | |
| public static void main(String[] args) throws Exception { | |
| Document doc = Jsoup.connect("http://en.wikipedia.org/").get(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| import java.io.Console; | |
| public class DBConnectHidePassword { | |
| public static void main(String[] args) throws Exception | |
| { | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| Console cons = System.console(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| public class DBPaginate { | |
| public static void main(String[] args) throws Exception | |
| { | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| Connection connect = | |
| DriverManager.getConnection("jdbc:mysql://localhost:8889/java_demo","root","root"); | |
| String query = "SELECT * FROM messages LIMIT 5 OFFSET 10"; // OR LIMIT 10,5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| public class DBInsert { | |
| public static void main(String[] args) throws Exception | |
| { | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| Connection connect = | |
| DriverManager.getConnection("jdbc:mysql://localhost:8889/java_demo","root","root"); | |
| String updateStatemnt = "INSERT into messages(user,message) values(?,?)"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| public class DBSelect { | |
| public static void main(String[] args) throws Exception | |
| { | |
| // load driver, for JDBC 3 and earlier | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| // make the connection using the supplied credentials | |
| Connection connect = | |
| DriverManager.getConnection("jdbc:mysql://localhost:8889/java_demo","root","root"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| public class DBConnectWithExceptions { | |
| public static void main(String[] args) | |
| { | |
| Connection connect = null; | |
| Statement st = null; | |
| try{ | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| connect = DriverManager.getConnection("jdbc:mysql://localhost:8889/java_demo","root","root"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.sql.*; | |
| public class DBConnect { | |
| public static void main(String[] args) throws Exception | |
| { | |
| // load driver, for JDBC 3 and earlier | |
| Class.forName("com.mysql.jdbc.Driver"); | |
| // make the connection using the supplied credentials | |
| Connection connect = | |
| DriverManager.getConnection("jdbc:mysql://localhost:8889/java_demo","root","root"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title></title> | |
| <style type="text/css"> | |
| #wrapper { | |
| position: relative; | |
| } | |
| #wrapper div, #wrapper video { | |
| position: absolute; | |
| top: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title></title> | |
| <style type="text/css"> | |
| #wrapper { | |
| position: relative; | |
| } | |
| #wrapper div, #wrapper video { | |
| position: absolute; | |
| top: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.net.*; | |
| class EngineMonitoringConsole | |
| { | |
| public static void main(String[] argv) throws Exception | |
| { | |
| int port = 5000; | |
| if (argv.length > 0) { |