Page 1 of 2
not able to connect sql server 2005
PostPosted:Tue Mar 08, 2011 1:03 pm
by prashanth
Dear Sir
I liked OpenKM very much. Now i m working on this. But i not able to connect openkm to sql server 2005. I am reading wiki/openkm(documentation). but still i not able to connect. In documentation i read generating database script. is it nessaccery to exicute that piece of code?. In my SQLserver portion i did asitis there. I created 2 databases. enabled TCP/IP in configuration manager. In JBoss datasource portion i not found sql server 2005 type mapping portion in standardjbosscmp-jdbc.xml file. I dont no what i am missing. Please give me an solution for my problem.
Thankyou
Regards
Prashanth
Re: not able to connect sql server 2005
PostPosted:Tue Mar 08, 2011 7:33 pm
by pavila
What is the error? Maybe you need a MsSQLServer JDBC driver.
Re: not able to connect sql server 2005
PostPosted:Wed Mar 09, 2011 4:48 am
by prashanth
Dear Sir
I downloaded sqljdbc_2.0.1803.100_enu from net. I copied sqljdbc,sqljdbc4 jar files into destination folder as you mentioned in the document. Even though after i run jboss, Finally i getting this error. Please give me an solution for this
Code: Select allCaused by: java.sql.SQLException: Table not found in statement [/* from CronTab
ct order by ct.id */ select crontab0_.CT_ID as CT1_33_, crontab0_.CT_NAME as CT2
_33_, crontab0_.CT_EXPRESSION as CT3_33_, crontab0_.CT_TYPE as CT4_33_, crontab0
_.CT_FILE_CONTENT as CT5_33_, crontab0_.CT_FILE_NAME as CT6_33_, crontab0_.CT_MA
IL as CT7_33_, crontab0_.CT_ACTIVE as CT8_33_, crontab0_.CT_LAST_BEGIN as CT9_33
_, crontab0_.CT_LAST_END as CT10_33_ from OKM_CRON_TAB crontab0_ order by cronta
b0_.CT_ID]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepar
eStatement(BaseWrapperManagedConnection.java:449)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareS
tatement(BaseWrapperManagedConnection.java:437)
at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(Wr
appedConnection.java:243)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatch
er.java:505)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatch
er.java:423)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatc
her.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 11 more
Isit nessacery to exicute this piece of code that mentioned in generating database script portion. for comiling this code we need an comiler. I installed jdk,jre also. but still i not able to compile.
Code: Select allimport java.io.File;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class Test {
public static void main(String[] args) throws Exception {
Configuration cfg = new Configuration();
cfg.configure(new File("/path/to/hibernate.cfg.xml"));
SchemaExport se = new SchemaExport(cfg);
se.setOutputFile("/path/to/schema.sql");
se.setFormat(true);
se.create(false, false);
}
}
Re: not able to connect sql server 2005
PostPosted:Wed Mar 09, 2011 7:59 am
by jllort
The java application you post generates the sql script. You must do minimal changes on default generated script, due running on sql Server ( that's the aditional script we put on the wiki ).
Do you've got tables on okm_app ? Have been generated some ? seems the table crontab not exists
Re: not able to connect sql server 2005
PostPosted:Thu Mar 10, 2011 5:04 am
by prashanth
Dear Sir
Yea Sir. Its not generated any tables. What is crontab? I have no idea about this.
Re: not able to connect sql server 2005
PostPosted:Thu Mar 10, 2011 8:06 am
by jllort
Is the property hibernate.hbm2ddl=create in your OpenKM.cfg
Sure you've got some problem with jdbc connection !!!
Delete server.log and take a look at starting must appearing some error explaining what happens, because it's completely sure that OpenKM is not connecting to your DBMS could be several problems, the driver is not copied in lib folder, the url connection or pass are wrong, etc...
Test with some client that your connection data is right, not using SQL Server Studio that obviously can connect to DBMS and is not good for testing if your DBMS exposed configuration is right done.
Re: not able to connect sql server 2005
PostPosted:Sat Mar 12, 2011 9:11 am
by prashanth
Dear Sir
I copied 2 jar file into lib folder. I got only 2 jar file. Is there any other drivers to copy to lib folder. Please let me know.
Re: not able to connect sql server 2005
PostPosted:Sat Mar 12, 2011 10:52 am
by jllort
You must only copy 1 jar
Which have you copied ?
Re: not able to connect sql server 2005
PostPosted:Sat Mar 12, 2011 12:09 pm
by prashanth
I copied sqljdbc,sqljdbc4 jar files into lib folder
Re: not able to connect sql server 2005
PostPosted:Mon Mar 14, 2011 4:46 am
by prashanth
Hello sir
I copied sqljdbc, sqljdbc4 jar files into lib directory. Now i given an path for java in environmental variable for compiling java file. After that when i try to run jboss using a command run -b 0.0.0.0, Its not showing anything(No error msg, nothing). I checked in services also, jboss not running. I m working in server 2008(64) bit. Please give me an solution
Re: not able to connect sql server 2005
PostPosted:Mon Mar 14, 2011 12:58 pm
by jllort
That's other kind of problem, that has no relation with sql server.
You've changed your java home no ? the problem is there.
Re: not able to connect sql server 2005
PostPosted:Tue Mar 15, 2011 4:37 am
by prashanth
Thank you sir for replaying.
I solved that problem. that is b'use changes in the home path. But now i return to same problem. I copied sqljdbc, sqljdbc4 jar file into lib directory. Actually i not understand the type mapping part in the Jbossdatasource . Where i should place that piece of code?. Pleace explain me. what i did is i copied that piece of code into mssql-ds.xml file in the \jboss-4.2.3.GA\docs\examples\jca directory. then i changed the username into the username is used to connect the sqlserver 2005. Their is no password used for connect the server 2005 , So i kept password nothing.
Please let me know what is the mistake i did? What is the solution.
Re: not able to connect sql server 2005
PostPosted:Tue Mar 15, 2011 7:35 am
by jllort
You've got a file called openkm-ds.xml into server/default/deploy you must make the changes there.
Don't worry about standardjbosscmp-jdbc.xml and the mapping, because we don't using CMP on OpenKM and really this definition it's not used by application.
Re: not able to connect sql server 2005
PostPosted:Tue Mar 15, 2011 8:03 am
by prashanth
Thank you sir. I wil try now. so i have to copy the code in the Jbossdatasource into openkm-ds.xml file. Is it correct?
Re: not able to connect sql server 2005
PostPosted:Tue Mar 15, 2011 11:42 am
by prashanth
I just edited openkm-ds file. After that i run the jboss, I not getting an error that showing before like 'Table not created something lik that. I already added error block in my forum.Now its not giving any error like this. But tables are not created in database. I dontno what is happening. Please giv me an solution