/* i a
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.io.Console;

public class BillGen6
{
// JDBC driver name and database URL
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DATABASE_URL = "jdbc:mysql://localhost/cscs";
static final String QUERY1 = "SELECT * from soc1memberbill";
static final String QUERY2="SELECT* from soc1tarrifcharges";


public static void main( String args[] )
{
Connection connection1 = null; // manages connection
Statement statement1 = null; // query statement
Statement statement2=null;

// connect to database books and query database
try
{
Class.forName( JDBC_DRIVER ); // load database driver class

// establish connection to database
connection1 =
DriverManager.getConnection( DATABASE_URL, "root", "sid123" );

// create Statement for querying database
statement1 = connection1.createStatement();
statement2= connection1.createStatement();

// query database
ResultSet resultSet1 = statement1.executeQuery(
QUERY1 );
ResultSet resultSet2=statement2.executeQuery(QUERY2);

// process query results
ResultSetMetaData metaData1 = resultSet1.getMetaData();
ResultSetMetaData metaData2 = resultSet2.getMetaData();
int numberOfColumns1 = metaData1.getColumnCount();
int numberOfColumns2=metaData2.getColumnCount();
System.out.println( "Data:" );


for ( int i = 1; i <= numberOfColumns1; i++ )
System.out.printf( "%-8s\t", metaData1.getColumnName( i ) );
System.out.println();
while ( resultSet1.next() )
{
/* for ( int i = 1; i <= numberOfColumns1; i++ )
System.out.printf( "%-8s\t", resultSet1.getObject( i ) );*/
int MMBC1=resultSet1.getInt("MMBC");
int MMAS1=resultSet1.getInt("MMAS");
int MMRQ1= resultSet1.getInt("MMRQ");
System.out.println(MMBC1+","+MMAS1+","+MMRQ1 );

System.out.println();
}

System.out.println("----");

for (int i = 1; i <= numberOfColumns2; i++)
System.out.printf( "%-8s\t",metaData2.getColumnName( i ) );
System.out.println();
while ( resultSet2.next() )
{
/*for ( int i =1; i <= numberOfColumns2; i++)
System.out.printf("%-8s\t", resultSet2.getObject( i ) );
*/
int MMBC2 = resultSet2.getInt("MMBC");
int MMAS2 = resultSet2.getInt("MMAS");
int MMRQ2 = resultSet2.getInt("MMRQ");
System.out.println(MMBC2+", "+MMAS2+", "+MMRQ2);
}

while (resultSet1.next() && resultSet2.next() )
for ( int i =1; i <= numberOfColumns2; i++)
{
int MMBC3 = (int)( MMBC1* MMBC2);
System.out.println("MMBC3"+"="+MMBC3);
}
}
catch ( SQLException sqlException )
{
sqlException.printStackTrace();
System.exit( 1 );
}
catch ( ClassNotFoundException classNotFound )
{
classNotFound.printStackTrace();
System.exit( 1 );
}
finally // ensure statement and connection are closed properly
{
try
{
statement1.close();
statement2.close();
connection1.close();


}


catch ( Exception exception )
{
exception.printStackTrace();
System.exit( 1 );
}


}
}

}

/*i am trying to multiply two values from two different tables but i am getting error int MMBC3 = (int)( MMBC1* MMBC2);