Replace the missing values for given automobile dataset
“imports-85.data” with user
specified global constant.
Download Dataset From:
https://github.com/nyuvis/datasets/blob/master/auto/imports-85.data
Dataset Information:
https://archive.ics.uci.edu/ml/machine-learning-databases/autos/imports-85.names
Code:
import java.sql.*;
import java.util.TimeZone;
public class dm1 {
public static void main(String[] args) throws Exception{
// TODO Auto-generated
method stub
Class.forName("oracle.jdbc.driver.OracleDriver");
TimeZone t1;
t1 = TimeZone.getTimeZone("yourtimezone");
TimeZone.setDefault(t1);
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "s16cos140", "student");
PreparedStatement ps = con.prepareStatement("update DM set
NORMALIZED_LOSSES=120,BORE=3.12,STROKE=3.76,HORSEPOWER=105,PEAK_RPM=5800,PRICE=12024
where NORMALIZED_LOSSES='?' OR BORE='?' OR STROKE='?' OR HORSEPOWER='?' OR
PEAK_RPM='?' OR PRICE='?'");
int i = ps.executeUpdate();
if(i>0)
System.out.println("Value Updated
Sucessfully...");
}
}
No comments:
Post a Comment