ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vlada Djurovic <vdjuro...@gmail.com>
Subject Re: MalformedURLException: no protocol
Date Fri, 05 Aug 2005 07:33:45 GMT
I'm sorry for the delay. Here's the complete config file:

<----------------------BEGIN CONFIG ------------------------>

<sqlMapConfig>
    <!--<properties resource="config/dbconn.properties" />-->
   
    <settings cacheModelsEnabled="true" enhancementEnabled="true"
lazyLoadingEnabled="true"
            maxRequests="32" maxSessions="10" maxTransactions="5"
useStatementNamespaces="false" />
            
     <typeAlias alias="person" type="net.pack.Person" />
     <transactionManager type="JDBC">
        <dataSource type="SIMPLE" >
            <property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
            <property name="JDBC.ConnectionURL"
value="jdbc:mysql://localhost/ibatistest" />
            <property name="JDBC.Username" value="name" />
            <property name="JDBC.Password" value="pass" />
        </dataSource>
     </transactionManager>
     
     <sqlMap resource="config/maps/PersonMap.xml" />
</sqlMapConfig>

<------------------------- END CONFIG ------------------------>

And here's the map file:

<--------------BEGIN MAP ------------------------->

sqlMap namespace="Person">
    <select id="getPerson" parameterClass="int" resultClass="net.pack.Person">
        SELECT pName,pLname FROM person WHERE pID=#value#
    </select>
    <insert id="setPerson" parameterClass="net.pack.Person">
        INSERT INTO person VALUES(#id#,#fname#,#lname#)
    </insert>
</sqlMap>

<----------------------- END MAP ----------------------->

On 8/4/05, James, Steven <Steven.James@logicacmg.com> wrote:
> can we see the rest of you config file....
> 
> ________________________________
> 
> From: Vlada Djurovic [mailto:vdjurovic@gmail.com]
> Sent: Thu 04/08/2005 13:05
> To: iBATIS list
> Subject: MalformedURLException: no protocol
> 
> 
> 
> Hi,
> 
> Iam new user of iBATIS, and i have a weird problem. I searched the
> archives and all over the internet, but can't find anything simmilar.
> 
> I try to do a simple app using SQL-maps tutorial.
> This is how Is aet up data source in sqlMapConfig file:
> 
> <transactionManager type="JDBC">
>         <dataSource type="SIMPLE" >
>             <property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
>            <property name="JDBC.ConnectionURL"
> value="jdbc:mysql://localhost/ibatistest"/>
>             <property name="JDBC.Username" value="name" />
>             <property name="JDBC.Password" value="pass" />
>         </dataSource>
>      </transactionManager>
> 
> And this is how I use it in main():
> 
>         SqlMapClient sqlMap=null;
>         String res="config/application-map-config.xml";
>         try{
>             Reader rd=Resources.getResourceAsReader(res);
>             sqlMap=SqlMapClientBuilder.buildSqlMapClient(rd);
>             System.out.println("map inited");
> -----------------------------------------------------------------------
> 
> When I execute this, I get a bunch of exceptions, something like:
> 
> com.ibatis.common.exception.NestedRuntimeException: Error occurred.
> Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.
> Cause: java.net.MalformedURLException: no protocol:
> Caused by: java.net.MalformedURLException: no protocol:
> 
> So I figure the database URL is invalid, but can't figure out why. I
> checked a dozen times, and it looks OK.
> If somebody could give me a hint, I would really appreciate it.
> Thanks
> 
> 
> 
> 
> This e-mail and any attachment is for authorised use by the intended recipient(s) only.
It may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.
> 
>

Mime
View raw message