AnsweredAssumed Answered

How to create JDBC mySQL connection in Script

Question asked by km581c on Aug 8, 2018
Latest reply on Aug 9, 2018 by gajsr01


I am trying to set the connection for MySQL in the script: So far it is throwing me an error

Below is the code. Can you please help me where I am doing mistake. For url and Pwd, I am giving credentials, but didn’t mention here


import java.sql.*;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import javax.sql.DataSource;


String dbUrl =" :3306";

String username = "avcmg_user"; 

String password = "directv1" ;




Connection con = DriverManager.getConnection("dbUrl","username", "password");

Statement stmt=con.createStatement();            

String query ="select guide_ccid from av_channels";

ResultSet rs= stmt.executeQuery(query);