Void DBConnection()
{
LoginProperty LP = new LoginProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
#define.Constring("DSN=DSNName;UID=Username;PWD= ****")
;
LP.setOther(#Constring); //New line added by ramesh
myConnection = new OdbcConnection(LP);
myStatement = myConnection.createStatement();
myResult=myStatement.executeQuery("SELECT * from tablename");
while (myResult.next())
{
Name = any2str(myResult.getString(1));
Id = any2str(myresult.getString(2));
Date = any2date(myresult.getString(3));
}
}
{
LoginProperty LP = new LoginProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
#define.Constring("DSN=DSNName;UID=Username;PWD= ****")
;
LP.setOther(#Constring); //New line added by ramesh
myConnection = new OdbcConnection(LP);
myStatement = myConnection.createStatement();
myResult=myStatement.executeQuery("SELECT * from tablename");
while (myResult.next())
{
Name = any2str(myResult.getString(1));
Id = any2str(myresult.getString(2));
Date = any2date(myresult.getString(3));
}
}
No comments:
Post a Comment