Page 1 of 1
Connection String in PHP using JDBC
Posted: Fri Feb 27, 2009 4:55 am
by rajani
Hi Everybody,
Can we connect any database in php using JDBC. If Yes then please let me know woh we can connect it or if not then what is the reason behind it.
With Regards
Rajani Gupta
Re: Connection String in PHP using JDBC
Posted: Fri Feb 27, 2009 5:03 am
by jayshields
JDBC is an API for Java to connect to databases. Why would you need to use JDBC in PHP?
Re: Connection String in PHP using JDBC
Posted: Wed Mar 04, 2009 2:32 am
by rajani
i need to know only that how can we connect oracle using php? JDBC connectivity is possible in php or not.
Re: Connection String in PHP using JDBC
Posted: Wed Mar 04, 2009 2:44 am
by rajani
We are using server which is supporting only JDBC connections.
Re: Connection String in PHP using JDBC
Posted: Wed Mar 04, 2009 10:29 am
by jayshields
Your Oracle server only accepts JDBC connections? Well, in that case, you're going to have trouble connecting to it using PHP.
If not, PHP has extensions for working with Oracle.
This search told me that.
Re: Connection String in PHP using JDBC
Posted: Thu Mar 05, 2009 3:38 am
by Chris Corbyn
If you're looking for PHP's JDBC equivalent, it's PDO.
http://php.net/pdo
Re: Connection String in PHP using JDBC
Posted: Sun Apr 26, 2009 8:52 pm
by Nisha3102
Hi Rajani..
I am stuck with the same pbm. I want to know how can I get jdbc connection in php. If you have got the solution plz reply
Re: Connection String in PHP using JDBC
Posted: Mon Apr 27, 2009 6:33 am
by jayshields
Theoretically you could actually do it, but it'll be much better for you if you just reconfigure the database to not only accept JDBC connections.
Re: Connection String in PHP using JDBC
Posted: Thu May 14, 2009 4:29 pm
by Nisha3102
I am trying to integrate php and jasper reports. I have to generate a report from db and for that I need a jdbc connection object in php. Could any one please help me on this. I have referred some links on google .They all mention the same process of creating an instance of a java class and then calling a getConnection() method of that class.
Following the getCOnnection() method
Code: Select all
public Connection getConnection()
{
Connection conn = null;
try {
//Change these settings according to your local configuration
Class.forName(this.getDriver());
conn = DriverManager.getConnection(
this.getConnectString(),
this.getUser(),
this.getPassword());
//return conn;
}catch(ClassNotFoundException e){
e.printStackTrace();
}catch(SQLException e){
e.printStackTrace();
}
return conn;
}
But when I call this method from php it doesnt return me anything . Could anyone please help me. Actually I need the connection object to send as a parameter to Jasper report FillManagerClass.