import java.sql.Statement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DriverManager;
import java.sql.ResultSet;
class db
{
public static void main(String arg[])
{
Statement statementObj=null;
Connection connectionObj=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connectionObj=DriverManager.getConnection("jdbc:odbc:sensorData","","");
statementObj=connectionObj.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
System.out.println("do not worry ho ga yr ho ga");
statementObj.executeUpdate("INSERT INTO hardwareData (Time, Date, humidity, Temp, DiesalLevel) VALUES('1','12','3','s','a')");
connectionObj.close();
}
catch(ClassNotFoundException e)
{
System.out.println("class not found exception");
}
catch(SQLException e)
{
e.printStackTrace();
}
}
}
bhallarahul -4 Light Poster
mKorbel 274 Veteran Poster
dononelson 2 Junior Poster in Training
ivatanako 1 Junior Poster
bhallarahul -4 Light Poster
bhallarahul -4 Light Poster
bhallarahul -4 Light Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
ivatanako 1 Junior Poster
bhallarahul -4 Light Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.