摘要:
package com.anllin.test;public class Fibonacci{ public static void main(String[] args) { System.out.println(fibonacciWithRecursion(30)); System.out.println(fibonacciWithNotRecursion(30)); } public static long fibonacciWithRecursion(int pos) { if (1 == pos || 2 == pos) return 1; else return fibonacci 阅读全文
摘要:
import java.sql.*;public class TestJDBC { public static void main(String[] args) { ResultSet rs = null; Statement stmt = null; Connection conn = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); //new oracle.jdbc.driver.OracleDriver(); conn = DriverManager.getConnection("j 阅读全文
摘要:
package com.anllin.sqlserver;import java.sql.*;public class SqlserverTest{ public static void main(String[] args) { sqlsserver2005Test(); } public static void sqlsserver2005Test() { String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=test;username=sa;password=123"; Connect 阅读全文
摘要:
package com.anllin.mysqltest;import java.sql.*;public class MysqlTest{ public static void main(String[] args) { connetMysqlTest(); } public static void connetMysqlTest() { String connectionUrl = "jdbc:mysql://localhost:3306/mydata?user=root&password=123"; Connection conn = null; Statem 阅读全文