我是 javascript 的新手。我只是想知道是否可以仅使用 javascript 获取数据库详细信息。我知道 javascript 是客户端组件。通常使用我们获取数据库详细信息的方法。
public static void main(String args[]) throws SQLException {
//URL of Oracle database server
String url = "jdbc:oracle:thin:@localhost:1632:XE";
//properties for creating connection to Oracle database
Properties props = new Properties();
props.setProperty("user", "scott");
props.setProperty("password", "tiger");
//creating connection to Oracle database using JDBC
Connection conn = DriverManager.getConnection(url,props);
String sql ="select sysdate as current_day from dual";
//creating PreparedStatement object to execute query
PreparedStatement preStatement = conn.prepareStatement(sql);
ResultSet result = preStatement.executeQuery();
while(result.next()){
System.out.println("Current Date from Oracle : " + result.getString("current_day"));
}
System.out.println("done");
}
}
是否可以仅使用适用于 windows、linux 等任何机器以及 mozilla、IE、Safari 等任何浏览器的 javascript 来获取相同的东西?任何指针,建议真的有助于我理解 javascript 的力量。