|
|
|
Re: Server Plugins [message #738769 is a reply to message #737006] |
Sun, 16 October 2011 18:31 |
Eclipse User |
|
|
|
My guess is you are writing your own jdbc connection (db support
bundle). If so following these steps:
1. create a plugin project lets say 'org.eclipse.scout.rt.jdbc.microsoft'.
2. create the folder 'org.eclipse.scout.rt.jdbc.microsoft/lib' put the
jdbc driver jar (lets say sqljdbc.jar) in there.
3. open 'org.eclipse.scout.rt.jdbc.microsoft/META-INF/MANIFEST.MF'.
Switch to the 'Runtime' tab and add the sqljdbc.jar to the 'Classpath' box.
4. open 'org.eclipse.scout.rt.jdbc.microsoft/META-INF/MANIFEST.MF'.
Switch to the 'Dependencies' tab and add 'org.eclipse.scout.rt.server'
to the 'Required Plug-ins' box.
5. open 'org.eclipse.scout.rt.jdbc.microsoft/META-INF/MANIFEST.MF'.
Switch to the 'MANIFEST.MF' tab and add the line:
'Eclipse-RegisterBuddy: org.eclipse.scout.rt.server' (without the ').
6. create a new class
'org.eclipse.scout.rt.jdbc.microsoft.AbstractMicrosoftSqlService' like:
public abstract class AbstractMicrosoftSqlService extends
AbstractSqlService {
@Override
protected String getConfiguredJdbcDriverName() {
return "com.microsoft.jdbc.sqlserver.SQLServerDriver";
}
@Override
protected String getConfiguredJdbcMappingName() {
return "jdbc:microsoft:sqlserver://<servername>:<port>";
}
}
7. Open the '*.product' files of your server bundle. Switch to the
'Dependencies' tab and add the created plugin
'org.eclipse.scout.rt.jdbc.microsoft'. (If you do not need the derby sql
service you can remove the bundle 'org.eclipse.scout.rt.jdbc.derby' from
the dependencies).
8. Switch to the Scout perspective and create a new Sql Service
'server/Common Services/Sql Services'. Use 'AbstractMicrosoftSqlService'
as a super type.
9. Override the 'getConfiguredJdbcMappingName' and replace <servername>
and <port>. If username and password is required override the methods
'getConfiguredUsername' and 'getConfiguredPassword'.
In some case you need also to write your own SQL Style (see
getConfiguredSqlStyle). For more information take a look at
org.eclipse.scout.rt.jdbc.derby bundle.
Hope it helped...
-andreas
On 14.10.2011 17:09, bertin wrote:
> Thanks,
>
> one step further. It can find the bundles now, not the class inside. As
> far as I can see the class is in the bundle ().
>
>
>
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:169)
> at
> org.eclipse.scout.rt.server.services.common.jdbc.internal.pool.SqlConnectionBuilder.createJdbcConnection(SqlConnectionBuilder.java:35)
>
> at
> org.eclipse.scout.rt.server.services.common.jdbc.internal.pool.SqlConnectionPool.leaseConnection(SqlConnectionPool.java:102)
>
> at
> org.eclipse.scout.rt.server.services.common.jdbc.AbstractSqlService.leaseConnectionInternal(AbstractSqlService.java:609)
>
> ... 61 more
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05447 seconds