Connection to database issues

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Sparticus
Posts: 227
Joined: 27 Feb 2006, 17:44
Location: Canada
Contact:

Connection to database issues

Post 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
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
Emilie217
Posts: 2
Joined: 16 Jan 2012, 02:40

Post 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?
Emilie217
Posts: 2
Joined: 16 Jan 2012, 02:40

Post 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....
Bosskafett
Posts: 41
Joined: 24 Jan 2012, 00:04

Database

Post by Bosskafett »

Try having a look at dans courses on youtube, he has a good tutorial on making mysql work on SFS PRO.
if(_global.is_rocketsnail == 1){
mc.snail._visible = true;
smartfox.setUserVariables({snl:1, init:false})
}
The Re-creator of Old Games ;D
Post Reply