私は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 の力を理解するのに本当に役立ちました。