I am trying to connect to secondary mysql db I get this error
java.sql.SQLException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.sql.SQLException
Message: Cannot get a connection, pool error: Could not create a validated object, cause: ValidateObject failed
Description: The DBManager Test SQL failed: SELECT * from ayarlar
Please double check your SQL code and make sure that Database server is running.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
DBConfig cfg = new DBConfig();
cfg.active = true;
cfg.driverName = "com.mysql.jdbc.Driver";
cfg.connectionString = "jdbc:mysql://{path.mywebsite.com}/my_dbname?characterEncoding=UTF-8";
cfg.userName = "my_user";
cfg.password = "password";
cfg.testSql = "SELECT * from password";
webDBManager = new SFSDBManager(cfg);
//localDBManager.init(getParentZone());
webDBManager.init(null);
Actually before login we were using php code it was checking if user is registered user in the site. We thought smartfox should connect to the db and check. But I am getting this error. With same credentials php can connect to that db.
What might be the problem. Would it be wise to use regular jdbc connection ?
like this
//STEP 2: Register JDBC driver
Class.forName("com.mysql.jdbc.Driver");
//STEP 3: Open a connection
System.out.println("Connecting to database...");
conn = DriverManager.getConnection(DB_URL,USER,PASS);
//STEP 4: Execute a query
System.out.println("Creating statement...");
stmt = conn.createStatement();
String sql;
sql = "SELECT id, first, last, age FROM Employees";
ResultSet rs = stmt.executeQuery(sql);
Thanks
Connection to secondary db
Re: Connection to secondary db
It looks like the test SQL isn't correct.
Is "password" actually the name of table inside your database?
thanks
Is "password" actually the name of table inside your database?
thanks
Re: Connection to secondary db
No I just trying to write dummy text it is SELECT * FROM ayarlar
Re: Connection to secondary db
Sorry it was my fault it was wrong table name in the test query
Re: Connection to secondary db
Yes it works
Thanks
Thanks
Who is online
Users browsing this forum: Google [Bot] and 102 guests