Page 1 of 1

Connection to database issues

Posted: 28 Feb 2006, 21:28
by Sparticus
I feel like I'm spamming the support forums with questions... sorry about that. I assure you I've almost got the hang of everything :)

anyways, I am trying to connect to a postgres database on a linux box from windows (the foxserver is on the windows box).

Here is my database manager section in the config file :


Code: Select all

<DatabaseManager active="true">
				<Driver>org.postgresql.Driver</Driver>
				<ConnectionString>jdbc:postgresql://192.168.2.2/btg</ConnectionString>
		
				<UserName>postgres</UserName>
				<Password>mypass</Password>
				<TestSQL><![CDATA[SELECT COUNT(*) FROM accounts]]></TestSQL>

				<MaxActive>10</MaxActive>
				<MaxIdle>10</MaxIdle>
		
				<OnExhaustedPool>fail</OnExhaustedPool>
				<BlockTime>5000</BlockTime>
			</DatabaseManager>
I downloaded what I "think" was the correct driver for postgres at http://jdbc.postgresql.org/download.html

I wasn't sure where to put the JAR file so I put it in the /serber/lib directory where all the other JAR files are located. I even tried setting my classpath and that didn't seem to work.

here is the error message I get when i try and start the server :

Can't load db driver: org.postgresql.Driver

14:07:56.890 - [ SEVERE ] > DbManager could not retrive a connection. java.sql.SQLException: No suitable driver



any ideas?

thanx allot

Posted: 01 Mar 2006, 06:51
by Lapo
I feel like I'm spamming the support forums with questions... sorry about that. I assure you I've almost got the hang of everything
No worries, that's ok :)

The simplest way to make the driver work is to put it in the lib/ext/ folder of your Java Runtime.
Just locate it on your HD and inside the jre directory you'll find the lib/ext/ path

Let us know if it works

:)

Posted: 16 Jan 2012, 02:52
by Emilie217
bump!

I'm having the same troubles.

I downloaded the jar and put it in lib/ext, recompiled my java extensions, restarted the server, restarted eclipse...

I'm out of stuff to restart... :S

I'm still getting this error : No suitable driver found for jdbc:postgresql://[server ip]/[db name]

This makes me a sad panda T_T

Anybody had this error and was able to resolve it?

Posted: 16 Jan 2012, 04:46
by Emilie217
At last! FOUND IT!!!

Well, to be honest, I messed around so much for this thing that I'm not 100% sure this step will resolve all your issues but what did it for me was to add the .jar in smartfox/server/lib and then edit the start.bat like described in this thread : http://forums.smartfoxserver.com/viewtopic.php?t=1878

I also made sure that it was in the jre/lib/ext (it turns out I had a java folder both in Program Files AND Program Files(x86)).

At first I was putting the .jar in the Program Files(x86) one but turns out eclipse was loading the one from Program Files.

NO idea if this is part of the solution as well.

Hope this will help someone someday....

Database

Posted: 24 Jan 2012, 00:14
by Bosskafett
Try having a look at dans courses on youtube, he has a good tutorial on making mysql work on SFS PRO.